110,538
社区成员
发帖
与我相关
我的任务
分享
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;//设置为整行被选中
string str = this.dataGridView1.CurrentRow.Cells["Luid"].Value.ToString(); //获取被选中行Luid的值
Form2 m = new Form2(str);
m.Show();
}
dataGridView1.DefaultCellStyle.SelectionBackColor = Color.Transparent;
dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Red;
SelectionChanged
事件中弹出窗口。