G
Guest
I have a DataGrid which I added a MouseUp event:
datagrid.MouseUp += new MouseEventHandler(onMouseUp);
which simply does:
if (e.Button == MouseButtons.Right) {
if(hti.Type == DataGrid.HitTestType.ColumnHeader) {
main_dg.ContextMenu = columnHeaderMenu;
} else if (hti.Type == DataGrid.HitTestType.Cell) {
main_dg.ContextMenu = leftClickCellMenu;
}
}
Now, this once worked fine, but lately something really odd has been
happening...
It seems to use the mouse coordinates of the LAST click... not the current
click- what in the world could cause that?
So for example, when I first load the dialog and right click the column
header, nothing happens. Then if I right-click a Cell, the Column Header menu
pops up. If I then right-click the column header, the Cell context menu pops
up! Whatever I last clicked seems to be the current target...
Why??
datagrid.MouseUp += new MouseEventHandler(onMouseUp);
which simply does:
if (e.Button == MouseButtons.Right) {
if(hti.Type == DataGrid.HitTestType.ColumnHeader) {
main_dg.ContextMenu = columnHeaderMenu;
} else if (hti.Type == DataGrid.HitTestType.Cell) {
main_dg.ContextMenu = leftClickCellMenu;
}
}
Now, this once worked fine, but lately something really odd has been
happening...
It seems to use the mouse coordinates of the LAST click... not the current
click- what in the world could cause that?
So for example, when I first load the dialog and right click the column
header, nothing happens. Then if I right-click a Cell, the Column Header menu
pops up. If I then right-click the column header, the Cell context menu pops
up! Whatever I last clicked seems to be the current target...
Why??