How to get Label control attached to another control

  • Thread starter Thread starter Le, Thanh-Nhan
  • Start date Start date
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
 
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"
 
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?
 
Back
Top