Hi
I have written a VB program that starts from Sub Main. Sub Main is in a Module and Also I have a form in my project.
How can I access to my form and it's controls from Sub Main
Thanks
Printable View
Hi
I have written a VB program that starts from Sub Main. Sub Main is in a Module and Also I have a form in my project.
How can I access to my form and it's controls from Sub Main
Thanks
You can reference a form directly by name i.e. if your form is called "Form1" and has a textbox "txtName" rthen the following is perfectly valid in code:
Debug.print Form1.txtName.Text
Note that your VB form is also a template for the creation of forms of the same type i.e.:
Dim frmThis as Form1
set frmThis = new Form1
Debug.print frmThis.txtName.Text
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com