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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which control was selected 1

Status
Not open for further replies.

simeybt

Programmer
Nov 3, 2003
147
GB
Hi,
I want to know how to find the name of a control that has just been selected by the user. for example if the user selects a button I want to find out the name of the button control so I can change the colour of it. Has anyone any idea of how this is done

Thanks

Simon
 
How do you plan on calling this code?

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
the code is called using the onclick event of the button. but the onclick event just calls a function like "=thisis()" instead of calling normal control click function. the reason for this is that there are 40 buttons and I don’t want a separate function for each click action. I want this function ( "=thisis()" ) to find out which button called it. is that clear

Simon
 
You may take a look at the Screen.ActiveControl property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV you are a life saver.

i only have two days left to do this an i just spent 4 hours on this simple problem. i thought i was going to have to redesign a major section of the program.
A simple solution, excellent!!!

A Star from me

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top