datagridview 右键选中行 并弹出菜单

datagridview 右键选中行 并弹出菜单
private void dataGridView_OLUsers_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                if (e.RowIndex >= 0)
                {
                    dataGridView_OLUsers.ClearSelection();
                    dataGridView_OLUsers.Rows[e.RowIndex].Selected = true;
                    dataGridView_OLUsers.CurrentCell = dataGridView_OLUsers.Rows[e.RowIndex].Cells[e.ColumnIndex];
                    contextMenuStrip1.Show(MousePosition.X, MousePosition.Y);
                }
            }
        } 
datagridview 右键选中行 并弹出菜单

datagridview 右键选中行 并弹出菜单

上一篇:mysql 安装-编码


下一篇:SQL Server :理解IAM 页