I have a datagridview, and when i use scrollbar the columns shown over the others, like this image:
i have tried DoubleBuffered like that:
1- i created a module named "DoubleBuffer.vb"
2- i add that code in it:
3- i call that module in Load Event:Code:Imports System Imports System.Reflection Imports System.Windows.Forms Module DoubleBuffer PublicSub DoubleBuffered(ByVal dgv As DataGridView,ByVal setting AsBoolean) Dim dgvType As Type = dgv.[GetType]() Dim pi As PropertyInfo = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance Or BindingFlags.NonPublic) pi.SetValue(dgv, setting,Nothing) EndSub EndModule
but it give me BLACK CellsCode:DoubleBuffer.DoubleBuffered(DataGridView1,True)
so, what is the problem i faced here?


Reply With Quote
