Handle
MouseDown
event
of
Panel
.
Check the sample code here.
private void panel3_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
panel3.ContextMenuStrip = contextMenuStrip3;
}
else
{
panel3.ContextMenuStrip = null;
}
}
[Added code formatting]