467,169 Members | 1,023 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

Accessing forms controls in module

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
Nov 20 '05 #1
  • viewed: 978
Share:
2 Replies
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

"Phil" <Ph**@nospam.com> wrote in message
news:c1**********@sparta.btinternet.com...
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

Nov 20 '05 #2
Well hell..................thanks! That's simple and I feel dumb I didn't
know :-)

Have a good one!

Rgds, Phil

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
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

"Phil" <Ph**@nospam.com> wrote in message
news:c1**********@sparta.btinternet.com...
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


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dave PNNZ | last post: by
4 posts views Thread by Jim Heavey | last post: by
7 posts views Thread by Sudhakara.T.P. | last post: by
3 posts views Thread by judy.j.miller@cox.net | last post: by
8 posts views Thread by colmkav | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.