How to get Label control attached to another control

L

Le, Thanh-Nhan

Hi,

My program need to know, which Label is attached (?) to each other controls,
in order to set or change their captions in runtime.

How can I do it?

Thanks
Nhan
 
A

Allen Browne

If Textbox1 has an attached label, it is the first (and only) member of its
Controls collection.

You can therefore change the Caption of the label like this:
Me.[Textbox1].Controls(0).Caption = "Whatever you want here"
 
L

Le, Thanh-Nhan

Thanks

Allen Browne said:
If Textbox1 has an attached label, it is the first (and only) member of its
Controls collection.

You can therefore change the Caption of the label like this:
Me.[Textbox1].Controls(0).Caption = "Whatever you want here"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Le said:
My program need to know, which Label is attached (?) to each other
controls,
in order to set or change their captions in runtime.

How can I do it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top