ani*_*kun 3 c# mouse contextmenu winforms
我有一个datagridview并需要上下文菜单.当我右键单击单元格(RED POINT) - 上下文菜单显示..但在错误的地方.无法理解为什么这里是代码:
ContextMenu m = new ContextMenu();
m.Show(ServersTable, new Point(Cursor.Position.X, Cursor.Position.Y));
Run Code Online (Sandbox Code Playgroud)

那东西真让我烦恼!
只需将点转换为网格:
m.Show(ServersTable, ServersTable.PointToClient(
new Point(Cursor.Position.X, Cursor.Position.Y)));
Run Code Online (Sandbox Code Playgroud)