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

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

    You may also try this, its work.

    public static void DoubleBuffered(Control formControl, bool setting)
    {
        Type conType = formControl.GetType();
        PropertyInfo pi = conType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
        pi.SetValue(formControl, setting, null);
    }
    

提交回复
热议问题