We help IT Professionals succeed at work.
Get Started

Datagridview flicker

koossa asked
Last Modified: 2012-07-06
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
  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?
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE