简体   繁体   中英

Event handling in C#

I am trying to design a windows form application. Now I have written an event handler for a button object to handle the Button.Click event. It worked fine until I wrote another event handler for Button.MouseDown to capture both left and right mouse clicks, in which case the only code that worked was the one for Mouse.ButtonDown. I understand that I can make the previous code work by copying the code from Button.Click to the section in MouseButtonDown that responds to left click. My question is that are there any event handlers that take precedence over others and if yes, in what order? Another thing that intrigues me is that are there any more event handlers that are ambiguous?

Here you got a detailed list of the mouse events and what they do in windows forms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM