From: Mr. X. on
Hello.
In VB.NET 2008 :
I created a user control.
The user control has label (one of its components).
I want :
When using the final user control by the IDE, I shall be able to pick up the
label control alone,
make events on it, or change the label text.

How can I do that ?

Thanks :)

From: Armin Zingler on
Am 15.04.2010 00:25, schrieb Mr. X.:
> Hello.
> In VB.NET 2008 :
> I created a user control.
> The user control has label (one of its components).
> I want :
> When using the final user control by the IDE, I shall be able to pick up the
> label control alone,
> make events on it, or change the label text.
>
> How can I do that ?

In the Usercontrol designer, select the label. Change the 'Modifier' to 'Public'.
After compiling, open the Form and select teh Usercontrol. The label appears
in the list of properties. Expand it to change it's properties. You have
to use the AddHandler statement to handle the label's events.

--
Armin
From: Mr. X. on
I need to see the label's event directly via the IDE.
(I want to be able to make a user control - built it, put it on the my form,
and see some of the inner elements of the controls, and be able to see their
events and properties on the IDE).
How can I do that ?
Any other way ? (like populate all the properties and events of the inner
control, to the main user control - but if there are 100 properties, I.e ?)

Thanks :)

"Armin Zingler" <az.nospam(a)freenet.de> wrote in message
news:u2hc#UC3KHA.5196(a)TK2MSFTNGP05.phx.gbl...
> Am 15.04.2010 00:25, schrieb Mr. X.:
>> Hello.
>> In VB.NET 2008 :
>> I created a user control.
>> The user control has label (one of its components).
>> I want :
>> When using the final user control by the IDE, I shall be able to pick up
>> the
>> label control alone,
>> make events on it, or change the label text.
>>
>> How can I do that ?
>
> In the Usercontrol designer, select the label. Change the 'Modifier' to
> 'Public'.
> After compiling, open the Form and select teh Usercontrol. The label
> appears
> in the list of properties. Expand it to change it's properties. You have
> to use the AddHandler statement to handle the label's events.
>
> --
> Armin

From: Armin Zingler on
Am 15.04.2010 06:30, schrieb Mr. X.:
> I need to see the label's event directly via the IDE.

"IDE" is a big term. The designer or the code editor?
If you use the Addhandler statement as I've suggested,
intellisense works as always and will list the events.

> (I want to be able to make a user control - built it, put it on the my form,
> and see some of the inner elements of the controls, and be able to see their
> events and properties on the IDE).
> How can I do that ?
> Any other way ? (like populate all the properties and events of the inner
> control, to the main user control - but if there are 100 properties, I.e ?)

The designer just simplifies creating code. What you want is not a feature.
You have to type "Addhandler MyUsercontrol1.MyLabel." and have intellisense
list the events. (BTW, I'v never used the events view in the properties window)

--
Armin
From: Mr. X. on
Sorry for my bad English.
I meant on design time, and not on runtime.

If there is no other choice I shall use Addhandler.

Thanks :)

"Armin Zingler" <az.nospam(a)freenet.de> wrote in message
news:OihkTYJ3KHA.1624(a)TK2MSFTNGP06.phx.gbl...
> Am 15.04.2010 06:30, schrieb Mr. X.:
>> I need to see the label's event directly via the IDE.
>
> "IDE" is a big term. The designer or the code editor?
> If you use the Addhandler statement as I've suggested,
> intellisense works as always and will list the events.
>
>> (I want to be able to make a user control - built it, put it on the my
>> form,
>> and see some of the inner elements of the controls, and be able to see
>> their
>> events and properties on the IDE).
>> How can I do that ?
>> Any other way ? (like populate all the properties and events of the inner
>> control, to the main user control - but if there are 100 properties, I.e
>> ?)
>
> The designer just simplifies creating code. What you want is not a
> feature.
> You have to type "Addhandler MyUsercontrol1.MyLabel." and have
> intellisense
> list the events. (BTW, I'v never used the events view in the properties
> window)
>
> --
> Armin