问题描述
- vb.net DataGridView 动态逐个选择所有单元格
-
For i As Integer = 0 To DataGridView1.Rows.Count - 1
i += 1
DataGridView1.Rows(i).Cells((DataGridView1.CurrentCell.ColumnIndex)).Selected = True
Next这样不行,用TIMER控件可能行,但是俺不会弄,请高手指点!
解决方案
For i As Integer = 0 To DataGridView1.Rows.Count - 1
i += 1
DataGridView1.Rows(i).Cells((DataGridView1.CurrentCell.ColumnIndex)).Selected = True
Application.DoEvents()
System.Threading.Thread.Sleep(100);
Next
解决方案二:
For i As Integer = 0 To DataGridView1.Rows.Count - 1
i += 1
DataGridView1.Rows(i).Cells((DataGridView1.CurrentCell.ColumnIndex)).Selected = True
Application.DoEvents()
System.Threading.Thread.Sleep(100)
Next
解决方案三:
如上图,想从单元格内容为1的开始逐单元格读取到36!
时间: 2024-09-21 13:54:35