T
Tanzen
Here's what I'm trying to do in vb.net 2005.
I have a public declared method that sets the value of a control on a
form, but that form could change, so I don't want to code its actual
name. I want it to be a parameter in the module method so that you
pass the form name of whatever form called the method.
So let's say we call the method from form 1:
UpdateText(frmName)
Then in the module we have the actual method
Public Sub UpdateText(ByVal frmName as Form)
frmName.textbox1.text = "Hi, I'm Me."
end Sub
Now, the problem that arises is that frmName gets underlined by visual
studio and says: TextBox1 is not a member of
'System.Window.Forms.Form'. So apparently my parameter in the method
is wrong. But I can't find out what type the form should be. Can
anyone help me?
Thanks
I have a public declared method that sets the value of a control on a
form, but that form could change, so I don't want to code its actual
name. I want it to be a parameter in the module method so that you
pass the form name of whatever form called the method.
So let's say we call the method from form 1:
UpdateText(frmName)
Then in the module we have the actual method
Public Sub UpdateText(ByVal frmName as Form)
frmName.textbox1.text = "Hi, I'm Me."
end Sub
Now, the problem that arises is that frmName gets underlined by visual
studio and says: TextBox1 is not a member of
'System.Window.Forms.Form'. So apparently my parameter in the method
is wrong. But I can't find out what type the form should be. Can
anyone help me?
Thanks