如何使窗口不能拖出屏幕? 你可以在mouse_move事件中定義移動距離為0! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try private void Form_Move(object sender, System.EventArgs e){ Size sz = SystemInformation.PrimaryMonitorSize;//获取监视器分辨率 Rectangle rect = this.DesktopBounds; if(rect.X < 0) this.DesktopBounds = new Rectangle(0,rect.Y,rect.Width,rect.Height); if(rect.Y < 0) this.DesktopBounds = new Rectangle(rect.X,0,rect.Width,rect.Height); if(rect.X > sz.Width - rect.Width) this.DesktopBounds = new Rectangle(sz.Width - rect.Width,rect.Y,rect.Width,rect.Height); if(rect.Y > sz.Height - rect.Height) this.DesktopBounds = new Rectangle(rect.X,sz.Height - rect.Height,rect.Width,rect.Height);//没有考虑Taskbar } 谢谢FileNewExit((呵呵)) 这分是你的了但在我原意是在拖动过程中,虚框不能拖出屏幕如果有谁解决了,另开帖给分!!! C#子线程接收串口数据,不用timer计时器怎么写。 如何设置dev控件GridControl、gridView中某一行不能被选中 在C#中怎么把一个Excel保存成为一个Html文件? C# 如何将文字转换为UTF-8格式 DataGridView 的取消行选择问题,高手请进!!!! 模版格式问题. 如何利用DirectX获取屏幕数据 .net C# office addIn安装不上去。 用C#做WEB出现怪问题????????? hashTable的问题 请教:随机函数是什么,怎么用,其命名空间是什么? 如何在两个windows窗体中传值???在线
{
Size sz = SystemInformation.PrimaryMonitorSize;//获取监视器分辨率
Rectangle rect = this.DesktopBounds;
if(rect.X < 0)
this.DesktopBounds = new Rectangle(0,rect.Y,rect.Width,rect.Height);
if(rect.Y < 0)
this.DesktopBounds = new Rectangle(rect.X,0,rect.Width,rect.Height);
if(rect.X > sz.Width - rect.Width)
this.DesktopBounds = new Rectangle(sz.Width - rect.Width,rect.Y,rect.Width,rect.Height);
if(rect.Y > sz.Height - rect.Height)
this.DesktopBounds = new Rectangle(rect.X,sz.Height - rect.Height,rect.Width,rect.Height);//没有考虑Taskbar
}
这分是你的了
但在我原意是在拖动过程中,虚框不能拖出屏幕
如果有谁解决了,另开帖给分!!!