Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine whether control or attached label was clicked 1

Status
Not open for further replies.

faeryfyrre

Programmer
Aug 4, 2003
198
AU
Hi,
Assume i have a textbox with an attached label. How can i determine whether the label or control was clicked. Ordinarily, Access just assumes the textbox was clicked, but i need to determine where the click happened.

For reasons i won't go into, the label needs to be attached to the textbox so unbinding the label and having a seperate click event for the label isn't an option.

Any insight will be greatly appreciated.

Thanks

Alec Doughty
Doughty Consulting P/L

"Life's a competition. Play hard, but play fair"
 
Hi,

The only way you can do it is to use the MouseDown Event. and check the X or Y arguments passed to the event. These values represent the position of the mouse cursor. So if you label is to left of the textbox the X value will be a negative number, or if the label is above the textbox the Y value will be negative.

HTH,

Dean.
 
Dean,
Thanks for the tip. A star for pointing me in the right direction.




Alec Doughty
Doughty Consulting P/L

"Life's a competition. Play hard, but play fair"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top