随笔分类 - C#_DataGridView
MS DataGridView
摘要:当用户单击某个单元格时,自动选中当前行。1 //单击某个单元格时,自动选中一行.2 private void dataGridView1_Click(object sender, EventArgs e)3 {4 if (this.dataGridView1.CurrentCell == null) //[BugHere][MustAdd]5 {6 return;7 }8 this.dataGridView1.Rows...
阅读全文
摘要:在MS DataGridView行的最前面显示行号,类似于Excel中的行号一样。实际上就是在DataGridView.RowPostPaint事件中重绘文本。 1 //在行的最前面处,手工绘制显示行号 2 private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) 3 { 4 Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, 5...
阅读全文

浙公网安备 33010602011771号