Link to home
Start Free TrialLog in
Avatar of koossa
koossa

asked on

Datagridview flicker

I have added a DataGridView to my form, set the form to maximize and Doc the DataGridview to fill, with the following code
Public Class Form1

  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim iRet As Integer
    DataGridView1.AlternatingRowsDefaultCellStyle.ForeColor = Color.Red
    DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Wheat
    For i = 1 To 20
      DataGridView1.Columns.Add("Col" & i, "Col" & i)
    Next i
    For j = 1 To 100
      iRet = DataGridView1.Rows.Add()
      For x = 1 To 20
        DataGridView1.Rows(iRet).Cells(x - 1).Value = x * j
      Next x
    Next
  End Sub
End Class

Open in new window


My problem is, when I press the mouse button, hold it in and move my mouse over the screen in circle movements, it is very slow and flicker as the selection changed.

Is there any way to get past this?
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

> when I press the mouse button, hold it in and move my mouse over the screen in circle movements, it is very slow and flicker as the selection changed.

Is that something your users will be doing frequently?
ASKER CERTIFIED SOLUTION
Avatar of ulrik_g
ulrik_g

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koossa
koossa

ASKER

Thank you, it seems like it is working!!!