2013年5月22日

C# DataGridView添加右键菜单等技巧(转)

摘要: 1).右键点击行时选中行,并弹出操作菜单1). 添加一个快捷菜单contextMenuStrip1;2). 给dataGridView1的CellMouseDown事件添加处理程序:复制内容到剪贴板程序代码private void DataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e){if (e.Button == MouseButtons.Right){if (e.RowIndex >= 0){//若行已是选中状态就不再进行设置if (dataGridView1.Rows[e.RowIn 阅读全文

posted @ 2013-05-22 11:19 星空夜夏梦 阅读(571) 评论(0) 推荐(0) 编辑

导航