注册 登录
编程论坛 VB.NET论坛

vb.net DataGridView 滚动条拖放屏幕闪烁

shxlife 发布于 2022-04-18 11:48, 1015 次点击
如何防止屏幕闪烁,请各位大侠提供代码
1 回复
#2
shxlife2022-06-01 22:34
    Dim cc As Integer
        Dim rr As Integer
        n_val = e.Value
        If Trim(o_val) <> Trim(n_val) Then
            '' MsgBox("数2据改变" & o_val & "--" & n_val)
            cc = DataGridView1.CurrentCell.ColumnIndex   '当前列号
            rr = DataGridView1.CurrentCell.RowIndex '当前行号
            DataGridView1.Rows(rr).Cells(cc).Style.BackColor = Color.Green  '改变颜色
            DataGridView1.Refresh()
        End If

其中上面代码中,  DataGridView1.Rows(rr).Cells(cc).Style.BackColor = Color.Green  '改变颜色 拿了,屏幕不会闪烁了

1