日期:2014-05-18  浏览次数:20766 次

怎么让绘图时候Invalidate屏幕不要出现闪烁?
我的程序中有一个功能,是让鼠标拖拽一些物体,这样在MouseMove事件中就得不停Invalidate一块区域,会出现闪烁现象,怎么才能避免这个现象?

------解决方案--------------------
VS2005的话,在Form的构造函数里加这个:this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true);