Click here to Skip to main content
15,881,810 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
how to disable right-click's option in windows using C# programmatically.

Thanks in advance....!
Posted
Comments
BillWoodruff 1-Mar-14 3:13am    
What are the windows in which you want right-click disabled ? Are you speaking of Windows at the OS level, or in an Application you wrote. Windows Forms ? WPF ? Disable in all windows ? Disable in a TextBox Control ?

Details, please.

At textbox level, simply set the textbox property "ShortcutsEnabled" to false and you got it.

Handle the right click on form and disable right click for e.g.
private void form_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == System.Windows.Forms.MouseButtons.Right)
    {
         //more logic here
    }
}
 
Share this answer
 
Comments
sathish4303 1-Mar-14 4:21am    
am asking about desktop right click option....!
Abhinav S 1-Mar-14 4:58am    
Handle any event you want to.
sathish4303 1-Mar-14 7:13am    
i want to disable desktop r-click options like(Refresh,New,Properties,etc...)
you can do it by using java script

XML
</head>

<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">

....

</body>



or you can use it also in table prperty
 
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