Accessing forms controls in module

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi all,

If I remember correctly, in VB you can refer to your controls from a module
simply by referring to ControlContainer, ie. Form1.Textbox1.Text =
"something".

I have added a module to my project in .Net and I cannot access any of my
controls in Form1. In fact referring to Form1 brings up a very limited list
of properties. How do I get at my controls and properties?

Thanks,

Phil
 
Declare your form in your module, that's the only solution I know.
So in your module you type somewhere:
dim MyForm as new frmMyForm

and than you can in the module refer to all the methods ans properties by
using MyForm.fntMyFunction etc

Hope this helps, Pieter
 
Well hell..................thanks! That's simple and I feel dumb I didn't
know :-)

Have a good one!

Rgds, Phil
 
Back
Top