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

前端 未结 8 1866
悲哀的现实
悲哀的现实 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:33

    People seem to forget a simple fix for this:

    Object.Visible = false;
    
    //do update work
    
    Object.Visible = true;
    

    I know it seems weird, but that works. When the object is not visible, it won't redraw itself. You still, however, need to do the begin and end update.

提交回复
热议问题