DataGridView.HeaderCell.ContextMenuStrip怎样获取右键点击了哪一列??
现在的问题是:我设置好右键菜单以后,怎么样获取右键点击的是哪一列?
for (int i = 0; i < dataGridView1.Columns.Count; i++)
{
dataGridView1.Columns[i].HeaderCell.ContextMenuStrip = contextMenuStrip1;
}
private void contextMenuStrip1_Opened(object sender, EventArgs e)
{
//contextMenuStrip1.SourceControl 是 DataGridView
}
------解决方案--------------------接分
------解决方案--------------------lz,能说说解决方法吗