troubleshooting Question

Datagridview flicker

Avatar of koossa
koossa asked on
Visual Basic.NET
3 Comments1 Solution533 ViewsLast Modified:
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

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?
ASKER CERTIFIED SOLUTION
ulrik_g

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros