Cancel right-mouse click

M

Maurice Mertens

Hi all,

I want to cancel the right-mouse click on a control in VB.NET. Does anyone
know how to do this?


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 
A

Ajay Kalra

You could override WndProc of your control, look for WM_RBUTTONDOWN and
ignore it by not calling the base class. Call base class for all other
messages. Something like this(c# version):

protected override void WndProc(ref System.Windows.Forms.Message m)
{
if(m.Msg == 0x204) // WM_RBUTTONDOWN
{
return; // Dont call the base class here
}
base.WndProc(ref m); // pass it on to base class
}

_____________
Ajay Kalra (MVP - VC++)
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top