Should be a simple question

In a Microsoft Windows Application, how do you access the controls of a Form from a Module?  In VB6 the syntax to change the textbox on form "MyForm" from a module was something like: Form_FormName.mytextbox.Value = 2333.

Does anyone know the syntax for vb.net?
dchau12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pauljk1619Commented:
frmName.mytextBox.Text = 2333

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
It depends on the version of VB.Net you have...

For VB.Net 2003 and below, you can't use the Forms name like you used to in VB6.  You must have a reference to the form you want to iterate over.  This means either passing into your sub/function in your module or by declaring a global public form variable in your module and then setting that global variable from your forms load event.

In VB.Net 2005, you can use the Forms name just like you did in VB6.  VB.Net 2005 also has a forms collection similar to VB6:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.openforms(VS.80).aspx
There is no OpenForms() collection in VB.Net 2003 and below (there is for MdiChildren but thats different).  If you want one there you have to track the open forms yourself in a your own collection such as the ArrayList.
dchau12Author Commented:
Thanks for the input guys
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.