日期:2014-05-17 浏览次数:21702 次
//减少闪烁 //SetStyle(ControlStyles.SupportsTransparentBackColor , true); //SetStyle(ControlStyles.AllPaintingInWmPaint , true); //SetStyle(ControlStyles.UserPaint , true); //双缓冲 SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.ResizeRedraw, true); //this.Refresh();
------解决方案--------------------
两个方法:
1、使用双缓冲内存位图直接操作;
2、使用wpf做个界面给程序调用.
------解决方案--------------------
第三方控件不好吗
------解决方案--------------------
#region 窗体缩放 const int WM_NCHITTEST = 0x0084; const int HTLEFT = 10;//左边界 const int HTRIGHT = 11;//右边界 const int HTTOP = 12;//上边界 const int HTTOPLEFT = 13;//左上角 const int HTTOPRIGHT = 14;//右上角 const int HTBOTTOM = 15;//下边界 const int HTBOTTOMLEFT = 0x10;//左下角 const int HTBOTTOMRIGHT = 17;//右下角 protected override void WndProc(ref Message m) { base.WndProc(ref m); switch (m.Msg) { case WM_NCHITTEST: { Point vPoint = new Point((int)m.LParam & 0xFFFF, (int)m.LParam >> 16 & 0xFFFF); vPoint = PointToClient(vPoint); //判断:仅当当前窗体状态不是最大化时,相关鼠标事件生效 if (this.WindowState != FormWindowState.Maximized) { if (vPoint.X <= 5) { if (vPoint.Y <= 5) { m.Result = (IntPtr)HTTOPLEFT; } else if (vPoint.Y >= ClientSize.Height - 5) { m.Result = (IntPtr)HTBOTTOMLEFT; } else { m.Result = (IntPtr)HTLEFT; } } else if (vPoint.X >= ClientSize.Width - 5) { if (vPoint.Y <= 5) { m.Result = (IntPtr)HTTOPRIGHT; } else if (vPoint.Y >= ClientSize.Height - 5) { m.Result = (IntPtr)HTBOTTOMRIGHT; } else { m.Result = (IntPtr)HTRIGHT; } } else if (vPoint.Y <= 5) { m.Result = (IntPtr)HTTOP; } else if (vPoint.Y >= ClientSize.Height - 5) { m