Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a WPF Custom Control inherited from Button.

How do I programatically get the custom control to capture the Click Event (so that I can record the action and do some internal work)
(basically I want to catch the event and set a certain property to a certain value) and make this part of the classes standard functionality.

From my understanding the custom control should be able to catch it's own even and do some work.
Posted
Updated 5-Feb-10 11:33am
v3

1 solution

Solved

I have realised why I had a problem.

I could not see the Click event

This was because I was not explicit enought in my class declaration:

I put
public class StateButton : Button

obviously picked the wrong button
public class StateButton : System.Windows.Controls.Button

This works

Then I just override the event
 
Share this answer
 
v2

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