Flickering during updates to Controls in WinForms (e.g. DataGridView)

前端 未结 8 1849
悲哀的现实
悲哀的现实 2021-01-05 10:43

In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid

8条回答
  •  难免孤独
    2021-01-05 11:17

    This worked for me.

    http://www.syncfusion.com/faq/windowsforms/search/558.aspx

    Basically it involves deriving from the desired control and setting the following styles.

    SetStyle(ControlStyles.UserPaint, true);
    SetStyle(ControlStyles.AllPaintingInWmPaint, true); 
    SetStyle(ControlStyles.DoubleBuffer, true); 
    

提交回复
热议问题