I am sure you’ve gotten this before:
Cannot refer to an instance member of a class from within a shared method
Well, instead of all the reasons why, I will just tell you one simple solution:
Pretend you’re doing this:
Public Shared Function getSomething() As Integer   For Each tControl As Control In FlowLayoutPanel1.Controls  Next End FunctionIt will ERROR.
Now Add the form name:
Public Shared Function getSomething() As Integer   For Each tControl As Control In sampleForm.FlowLayoutPanel1.Controls  Next End FunctionAnd run again!