Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement a double-right-click for winforms?

This question seems to point to the existence of a windows event for a double-right-click. How to implement it in a C# windows form, however, is less than clear.

What's the best way to implement double-right-click on a control such as a button?

(I'm thinking I must use MouseDown and keep track of the time between clicks. Is there a better way?)

like image 957
JYelton Avatar asked Sep 07 '10 20:09

JYelton


People also ask

What is the difference between click and Doubleclick?

Typically, a single click initiates a user interface action and a double-click extends the action. For example, one click usually selects an item, and a double-click edits the selected item.

What is the use of double-click while working on Windows?

On most systems, double-clicking an icon in the file manager will perform a default action on the object represented by the icon. Double-clicking an application program will launch the program, and double-clicking a file icon will open the file in a default application for that file's type or format.

Which button is used for double-clicking?

Practice double-clicking To double-click, press your left mouse button twice quickly. If you're using a laptop with a touchpad, you can also double-tap the touchpad.

What does double-click mean?

Meaning of double-click in Englishto press a computer mouse twice in order to tell the computer to do something: Double-click (on) the icon to start the program.


1 Answers

Override the WndProc function and listen for WM_RBUTTONDBLCLK, which as can be seen on this pinvoke page is 0x0206.

That pinvoke page also has some C# sample code for how to do it.

Whenever you see something about a windows message and/or windows API and you want to use it in C#, the pinvoke site is a good place to start looking.

like image 89
Hans Olsson Avatar answered Sep 22 '22 07:09

Hans Olsson