An active label?

  • Thread starter Thread starter george
  • Start date Start date
G

george

On my clients form I have a combo box, cboClients, and a
label, lblClients, next to it. No matter how hard I have
tried, I have not been able to select the whole text
inside the text box of the combo box when I click in it.
However I have found out another way to bypass the problem:
I click on the label and the text in the combo box is
automatically selected! Is this normal behaviour for a
label? On which of the label's properties is this based
on?
 
george said:
On my clients form I have a combo box, cboClients, and a
label, lblClients, next to it. No matter how hard I have
tried, I have not been able to select the whole text
inside the text box of the combo box when I click in it.
However I have found out another way to bypass the problem:
I click on the label and the text in the combo box is
automatically selected! Is this normal behaviour for a
label? On which of the label's properties is this based
on?

When you click on the combo box's "text box" section, the control first
gets the focus (which normally selects the text, if you have your
options set that way), and then processes the mouse click, which it
interprets as a command to position the text caret (the insertion point)
at the location in the text that was clicked -- thereby de-selecting the
text. When you tab into the control, or when you click on its attached
label, the control is given the focus, and hence its text is
automatically selected, but there is no mouse click to position the text
caret, and so the text remains selected.

As you see, it's not a special property of the label, except that
clicking the label attached to any control will give that control the
focus, provided that the control can receive it.
 
THANKS DIRK FOR THE REPLY. GEORGE

-----Original Message-----


When you click on the combo box's "text box" section, the control first
gets the focus (which normally selects the text, if you have your
options set that way), and then processes the mouse click, which it
interprets as a command to position the text caret (the insertion point)
at the location in the text that was clicked -- thereby de-selecting the
text. When you tab into the control, or when you click on its attached
label, the control is given the focus, and hence its text is
automatically selected, but there is no mouse click to position the text
caret, and so the text remains selected.

As you see, it's not a special property of the label, except that
clicking the label attached to any control will give that control the
focus, provided that the control can receive it.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top