[Controls] Detect Autolabel

A

ALESSANDRO Baraldi

Hi and good Saturday Night.

Some one know how to detect if a Control(TextBox or ListBox or combo)
have a AutoLabel associated...?

I need to know for each one if and wich label is associated....!

This property is a defaultControl property setting, so i think is not
possible to change if we are not on Design view...., but i need
onli to read it....!

Thank for each suggestion.
 
A

ALESSANDRO Baraldi

ALESSANDRO Baraldi said:
Hi and good Saturday Night.

Some one know how to detect if a Control(TextBox or ListBox or combo)
have a AutoLabel associated...?

I need to know for each one if and wich label is associated....!

This property is a defaultControl property setting, so i think is not
possible to change if we are not on Design view...., but i need
onli to read it....!

Thank for each suggestion.

[AUTO REPLAY]

On the Parent property of Label if is Associated i point
to the Control directly...., so in Name property i check for the
Control Name.
To check if Control have an associated Label i point to
Controls(0).ControlType

Bye
 
M

Marshall Barton

ALESSANDRO said:
Hi and good Saturday Night.

Some one know how to detect if a Control(TextBox or ListBox or combo)
have a AutoLabel associated...?

I need to know for each one if and wich label is associated....!

This property is a defaultControl property setting, so i think is not
possible to change if we are not on Design view...., but i need
onli to read it....!


You can refer to txtbox.Controls(0).Name to get the name of
the attached label, if it exists. If there is no attached
label, trap error 2467.
 
A

ALESSANDRO Baraldi

Marshall Barton said:
You can refer to txtbox.Controls(0).Name to get the name of
the attached label, if it exists. If there is no attached
label, trap error 2467.


Many Thanks for replay, is the same solution that i find
i really check for ControlType=acLabel but is the same...!

Bye.
 
M

Marshall Barton

ALESSANDRO said:
Many Thanks for replay, is the same solution that i find
i really check for ControlType=acLabel but is the same...!


Sure. The error will occur for a reference to any property.
I just thought you wanted the name if the label did happen
to exist, so if you don't get an error, you already have the
label's name.
 

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