不接收鼠标点击我尝试使用按钮文件名和路径加载到DataGridView的细胞。 我放在这样一个单元中的按钮:按钮时,放置在DataGridView的
var cellRectangle = dataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false);
int buttonX = dataGridView.Location.X + cellRectangle.Location.X + cellRectangle.Width - btnLoadFile.Width;
int buttonY = dataGridView.Location.Y + cellRectangle.Location.Y;
btnLoadFile.Location = new Point(buttonX + 20, buttonY);
btnLoadFile.Height = cellRectangle.Height - 2;
btnLoadFile.Visible = true;
btnLoadFile.BringToFront();
我想用户点击该按钮,选择文件中的FileDialog等 问题是按钮不会获得任何点击。网格单元接收点击。
有没有人有一个想法,为什么它发生,我该如何处理呢?
使按钮为其他数据网格视图的孩子重新路由的按钮单击事件 –
@Uthistran:刚刚试了一下。该按钮仍然不响应点击.... – DmitryRibak
这听起来不对。你可能只是没有把它连接起来。如果您可以看到并单击它,__ will_将调用其单击事件。当你在设计器中双击它时会发生什么? – TaW