By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Control access

P: n/a
Is it possible to access a control on a User Control from a module via
directcast, or some other method? If so, how?

-Jason
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jason,

Expose the control with a property on the UserControl.

-Sam Matzen
"OpticTygre" <op********@adelphia.net> wrote in message
news:er********************@adelphia.com...
Is it possible to access a control on a User Control from a module via
directcast, or some other method? If so, how?

-Jason

Nov 20 '05 #2

P: n/a
How do you mean? Could you provide a sample?

Also, a little more information for you: My main form has a panel which
loads different user controls (mini forms, if you will) with controls on
them. Basically, I want to try and access a statusbar control on the
usercontrol from either the main form or a module. If the usercontrol
that's loaded isn't the right one, I'll just catch that in an exception.
Thanks, Sam.

"Samuel L Matzen" <sm*****@slm.com> wrote in message
news:e$**************@TK2MSFTNGP11.phx.gbl...
Jason,

Expose the control with a property on the UserControl.

-Sam Matzen
"OpticTygre" <op********@adelphia.net> wrote in message
news:er********************@adelphia.com...
Is it possible to access a control on a User Control from a module via
directcast, or some other method? If so, how?

-Jason


Nov 20 '05 #3

P: n/a
* "OpticTygre" <op********@adelphia.net> scripsit:
Is it possible to access a control on a User Control from a module via
directcast, or some other method? If so, how?


Set the control's 'Modifiers' property to 'Public', then use code like
this:

\\\
Public Sub Goo(ByVal Form As SimpleForm)
Form.UserControl1.Button1.Enabled = False
End Sub
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.