bh said:
I have two seperate instances of the control on two different forms.
I want to enable certain features on the user control if it is open in form a.
Does this help?
Sorta...
I haven't seen your project so I don't know 100% what you're trying to
do. There's probably a large number of ways you could do this. Also,
are you working in VB 2005, or C#?, or C++?
When you say "enable", so you mean you have UI controls where you want
to say
"someControl.enabled = false"?
Well, in Form A, you could just add code in the FormLoad procedure that
says
"myControl.someFeature.enabled = false"
for every feature you want to have disabled.
If you want to be able to do this through the designer, you can add
properties (I'm gonna assume you're in VB 2005, I don't know if C# has
similar features) to the code of the control itself, such as:
property enableFeatureOne as boolean
Get() as boolean
return Me.featureOne.enabled
End Get
Set (value as boolean)
Me.featureOne.enabled = value
End Set
End property
(It's monday morning so my syntax may be off
)
Then you can enable or disable the features right from the design view
of your Form A. (if you do it this way, make sure you rebuild the
project before attempting to use this property in the design view).
hope this helps.