당신이 시도 할 수 있습니다 몇 가지가 있습니다. 이 속성은 Form이 아닌 실제 DataGridView 인스턴스의 속성입니다. 보호 된 속성이므로 그리드를 하위 클래스로 설정해야합니다. 나는 작은 무승부 업데이트를 많이 본 적이
class CustomDataGridView: DataGridView
{
public CustomDataGridView()
{
DoubleBuffered = true;
}
}
는 일부 비디오 카드에 DataGridView에있는 시간이 걸릴, 이것은 그들이 디스플레이 퇴장하기 전에 그것들을 일괄 처리하여 문제를 해결할 수 있습니다.
당신이 시도 할 수있는 또 다른 점은 [어떻게 컨트롤에 대한 그림을 중단 할
다른 곳 코드에서
// ... this would be defined in some reasonable location ...
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
static extern IntPtr SendMessage(HandleRef hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam);
static void EnableRepaint(HandleRef handle, bool enable)
{
const int WM_SETREDRAW = 0x000B;
SendMessage(handle, WM_SETREDRAW, new IntPtr(enable ? 1 : 0), IntPtr.Zero);
}
당신의
HandleRef gh = new HandleRef(this.Grid, this.Grid.Handle);
EnableRepaint(gh, false);
try
{
this.doStuff();
this.doOtherStuff();
this.doSomeReallyCoolStuff();
}
finally
{
EnableRepaint(gh, true);
this.Grid.Invalidate(); // we need at least one repaint to happen...
}
가능한 중복이있을 것이다 WM_SETREDRAW는 Win32 메시지입니다 및 그 자녀?] (http://stackoverflow.com/questions/487661/how-do-i-suspend-painting-for-a-control-and-its-children) –
참조 http://stackoverflow.com/ 질문/487661/how-do-i-suspend-painting-for-a-contro l-and-its-children – Simon