Click here to Skip to main content
15,870,130 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In the form title, i wanna disable Quit button and use event: Right mouse double click instead of.

Can you give to me any code?
i'm using C#.
Thanks!
Posted
Comments
PIEBALDconsult 10-Sep-14 12:15pm    
Do you mean add an entry to the ContextMenu that comes up when the user right-clicks?
user8x86 10-Sep-14 12:23pm    
i mean: when user makes double right click, do this command: Close()
PIEBALDconsult 10-Sep-14 12:31pm    
Without asking for confirmation? Might not be a good idea.
[no name] 10-Sep-14 12:16pm    
Why are you unable to write this code yourself?
user8x86 10-Sep-14 12:19pm    
I don't really know the namespace to start.

1 solution

There is no such ready made function or event handler defined to do so
you have to make one
You can do this
I have tried this.

Use Mouse Double Click Event
And Use The Following Code

C#
private void label1_MouseDoubleClick(object sender, MouseEventArgs e)
       {
           if(e.Button==MouseButtons.Right)
           {
               MessageBox.Show("Close Application Code Goes Here");
           }
       }
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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