Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I have one need in my student entry system which is in wpf, that i have one user control there are two buttons in wpf.. i load that user control in window now i want that which button is clicked from the usercontrol from that window and according to the button clicked i want to call another user control and embed that into window.

Please help me in making this..

Thanks & Regards,
krunal Panchal
Posted
Comments
fct2004 31-Mar-12 22:51pm    
1. Do you want to add a new control every-time a button gets clicked?
2. Are there any controls you want to remove when a button gets clicked?
3. Are you saying you have different controls, and the one that gets added is dependent on which button is clicked?

1 solution

I think taht you should try to use
object sender
argument in event. You can use
Button btn = (Button)sender;
btn.Name

to get name of sender.
 
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