Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,



i have multiple buttons on a page and panel in which a form is created on that in the starting panel is invisible and when i click on any button outside the panel that panel is visible

now i want to identify which button is clicked and want to change the color of that when some event is fire from panel
Posted

try this

Button btn=sender as Button

if(btn.id=="your Button Id")
{

}
 
Share this answer
 
When an event fires, the object that is typically called 'sender' and is passed in to the event, is the control that sent the event. Cast it to button and check the id to work out which one it was.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900