Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DoubleBuffer Datagridview
 

DoubleBuffer Datagridview

i need to doublebuffer my datagrid to stop flickering, i have looked throught the threads on here and cannot find a VB.NET solution, i did find this in c# but i don't know what the translation to VB is.. can someone help please

Code Snippet

class DBDataGridView : System.Windows.Forms.DataGridView

{

public DBDataGridView() { DoubleBuffered = true; }

}

Remixer  Monday, June 18, 2007 11:09 PM

Try this:

Code Snippet

Public Class DBDataGridView

Inherits DataGridView

Public Sub New()

MyBase.New()

MyBase.DoubleBuffered=True

End Sub

End Class

Tony

tkerns  Tuesday, June 19, 2007 12:21 AM

Try this:

Code Snippet

Public Class DBDataGridView

Inherits DataGridView

Public Sub New()

MyBase.New()

MyBase.DoubleBuffered=True

End Sub

End Class

Tony

tkerns  Tuesday, June 19, 2007 12:21 AM

O.k. time for a dumb newbie question...

i have my already drawn datagrid, all it's functions work 100%, i put a lot of time into this, how do i get the above code to work with my existing grid, as you can tell i don't know much about classes..

I just wanna stop the flicker !!!

Thanks guys ... (i feel dumb)

Remixer  Tuesday, June 19, 2007 12:59 AM

anyone have any ideas on how i can stop my existing datagrid from flickering, or how i can incorparate the above code to my existing grid to stop the flicker ?

Thanks in advance !

Pete

Remixer  Tuesday, June 19, 2007 12:32 PM

someone on here must know how to do this ??

Remixer  Tuesday, June 19, 2007 11:28 PM
can microsoft actually answer this or do i just have to put up with another microsoft defective product !
Remixer  Wednesday, June 20, 2007 11:38 AM

O.K i guess i have to re-write and go over 100's of line of code because microsoft can't get it right the 1st time !

Remixer  Thursday, June 21, 2007 12:23 PM
I just found this:

http://www.csharp-examples.net/set-doublebuffered/
yeah1yeah  Thursday, November 20, 2008 9:31 PM

The easier way I am acustom to is:

1. Place a standard DataGridView control onto your form, then set all the parameter you want.

2. Go to yourform.Designer.vb, copy down the whole code (back up the code). Do not modify it cause you will get warning/error later.

3. Paste/plug inthe DBDataGridView class as given by tkerns in anywhere in your project, can be a new class, can be also inside the code of yourform.Designer.vb you back up at 2.

4. Modify Me.yourDataGridViewName = New DBDataGridView, Friend WithEvents yourDataGridViewName As DBDataGridView. *Modify this in the code you have back up!

5. Back to your form, deleted the DataGridView control that you put on your form.

6. Go to yourform.Designer.vb, replace the code with your back up code that already modified.

7. That suppose to work, if it is not, please let others people know. It is certainly solve the flickering problem, good luck for everyone who read this, please help others if you can, don't be too selfish.

ThankMSDNveryMuch  Monday, August 10, 2009 5:41 PM

You can use google to search for other answers

Custom Search

More Threads

• Stop DataGridView from Resetting
• Simple Row Group Explanation Sought After
• How to limit the number of characters in datagrid cell
• RichTextBox control hosted in Datagridview cell - properties question
• Duplicates in listview
• How to bind DataGridView to String collection
• Help.... Issues with hiding a single column
• datetimepicker and datagridview
• DataGridView not refreshing/updating when underlying DataTable value changes
• Control like firefox's Bookmarkmanager