A
Aaron Queenan
I have an event handler in a subclass of TreeView:
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
this.contextMenu.Show(this, new System.Drawing.Point(e.X, e.Y));
base.OnMouseUp(e);
}
When I right click, the menu pops up. If I left click somewhere outside the
menu, the menu disappears, but thereafter every LEFT click causes the event
to be fired again with e.Button == System.Windows.Forms.MouseButtons.RIGHT.
It works correctly in the list view.
Any suggestions as to what could be causing this and how to fix it?
Thanks,
Aaron Queenan.
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
this.contextMenu.Show(this, new System.Drawing.Point(e.X, e.Y));
base.OnMouseUp(e);
}
When I right click, the menu pops up. If I left click somewhere outside the
menu, the menu disappears, but thereafter every LEFT click causes the event
to be fired again with e.Button == System.Windows.Forms.MouseButtons.RIGHT.
It works correctly in the list view.
Any suggestions as to what could be causing this and how to fix it?
Thanks,
Aaron Queenan.