-
sending form to sub
i have aproblem to translet this vb6 code to vb.net
the code:
Public Sub ViewStatusBarProc(CurrentForm As Form)
CurrentForm.mnuViewStatusBar.Checked = 1
End Sub
the problem:
the function doesn't know that mnuViewStatusBar is member in the CurrentForm.
in vb6 there is no problem to do it
-
The error you are receiving is accurate because you are declaring your object variable as a generic form. You have to explicitly set your object variable to be the active instance of the form type that you are trying to reference. You will need to write code to determine which form you are currently working with by figuring out what the form's name is and then set the object variable to the current instance of that form.
You are venturing into an area where you need to have global instances of your forms declared and then have the ability to check the reference against the form that was passed into your procedure.
I guess the short answer is, there is no short answer.