-
Control Reference
How do I reference controls on other forms in VB .NET? In VB 6.0, you could just say form.control and then you could access that forms controls. The only way I can figure out how to do this is to declare an object as that form but then I need to be able to set the object to a instance of the form if the form is loaded. Any ideas on how to handle any of this?
-
for example :
Dim frm2 as new form2
frm2.Textbox1.Text
Is this what you mean ?
-
yes but how do I force that form variable to reference an already loaded instance of the form or does that not matter (i.e. will it automatically pickup a reference to the loaded form)?
-
Try to declare that in second form constructor (I think it should works) or put the variables in modal like this :
Dim frm2 as new form2
-
Here, read this. Should answer the question pretty well.
http://msdn.microsoft.com/library/de...adingtonet.asp