改变窗体大小时抖动的很厉害有办法解决吗? 设置this.FormBorderStyle = FormBorderStyle.None;然后利用贴图把图片贴上去,当拖动窗体边缘大小时,界面上抖动的很厉害,请问如何解决?谢谢!~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected override void WndProc(ref Message m){ switch (m.Msg) { case 0x0201: //WM_LBUTTONDOWN { Point point1 = Cursor.Position; point1 = PointToClient(point1); if (point1.X < 3) { SysSkinForm.SkinForm.ReleaseCapture(); SysSkinForm.SkinForm.SendMessage(base.Handle, 0x0112, 0xF001, 0); return; } else if (point1.X > Width - 3) { SysSkinForm.SkinForm.ReleaseCapture(); SysSkinForm.SkinForm.SendMessage(base.Handle, 0x0112, 0xF002, 0); return; } ... 这里其它的省略了... }base.WndProc(ref m);}我是这样写的,protected override void OnPaint(PaintEventArgs e){ base.OnPaint(e); DrawBackGroundImage(g); //这里是以9张图片重绘} public abstract class MouseAction { public abstract void Action(int ScreenX, int ScreenY, System.Windows.Forms.Form form); } public class MouseDrag : MouseAction { private object x; private int y; public MouseDrag(int hitX, int hitY) { x = hitX; y = hitY; } public override void Action(int ScreenX, int ScreenY, System.Windows.Forms.Form form) { form.Location = new Point(ScreenX - x, ScreenY - y); } } private int cursorLeft = 5; private int cursorRight = 5; private int cursorTop = 5; private int cursorBottom = 5; private int x = 0; private int y = 0; private MouseAction mouse; private void Form_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (!((mouse == null))) { mouse.Action(Control.MousePosition.X, Control.MousePosition.Y, this); } } private void Form_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { x = e.X; y = e.Y; if (e.Y < 40) { mouse = new MouseDrag(e.X, e.Y); } } private void Form_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { mouse = null; } SysSkinForm.SkinForm.SendMessage(base.Handle, 0x0112, 0xF002, 0);发送消息就直接可以改变窗体大小了,你的方法我也看过网上也有类似的,http://study.zhupao.com/infoview/Article_11306.html.鼠标拖动同样也很简单,不过却稍不同于窗口的缩放拉伸.是不是达不到那种有标题拖动大小效果呢!~ DataTable.Rows.count 为什么为0 c# tablelayoutpanel如何按顺序遍历 listbox如何传递选取中的值 C#中,如何读取ORACLE的表中的BLOB数据? 急急急ActiveX Component can't create object 欢迎加入群:9002533 高分求助!在C#怎么使用timer控件 请教一个问题 应该不会太难把 请高手们帮帮忙,非常急的问题,在线高分等待 请问如何写XML? 关闭无模式窗体时,怎么改变主窗体的显示? 安装vs2005问题
{
switch (m.Msg)
{
case 0x0201: //WM_LBUTTONDOWN
{
Point point1 = Cursor.Position;
point1 = PointToClient(point1);
if (point1.X < 3)
{
SysSkinForm.SkinForm.ReleaseCapture();
SysSkinForm.SkinForm.SendMessage(base.Handle, 0x0112, 0xF001, 0);
return;
}
else if (point1.X > Width - 3)
{
SysSkinForm.SkinForm.ReleaseCapture();
SysSkinForm.SkinForm.SendMessage(base.Handle, 0x0112, 0xF002, 0);
return;
}
... 这里其它的省略了...
}
base.WndProc(ref m);
}我是这样写的,
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
DrawBackGroundImage(g); //这里是以9张图片重绘
}
{ public abstract void Action(int ScreenX, int ScreenY, System.Windows.Forms.Form form);
}
public class MouseDrag : MouseAction
{
private object x;
private int y; public MouseDrag(int hitX, int hitY)
{
x = hitX;
y = hitY;
} public override void Action(int ScreenX, int ScreenY, System.Windows.Forms.Form form)
{
form.Location = new Point(ScreenX - x, ScreenY - y);
}
}
private int cursorLeft = 5;
private int cursorRight = 5;
private int cursorTop = 5;
private int cursorBottom = 5;
private int x = 0;
private int y = 0;
private MouseAction mouse; private void Form_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (!((mouse == null))) {
mouse.Action(Control.MousePosition.X, Control.MousePosition.Y, this);
}
} private void Form_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
x = e.X;
y = e.Y;
if (e.Y < 40) {
mouse = new MouseDrag(e.X, e.Y);
}
} private void Form_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
mouse = null;
}
发送消息就直接可以改变窗体大小了,你的方法我也看过网上也有类似的,http://study.zhupao.com/infoview/Article_11306.html.鼠标拖动同样也很简单,不过却稍不同于窗口的缩放拉伸.是不是达不到那种有标题拖动大小效果呢!~