C# WinForm,进来看看 想实现鼠标离开,窗体自动隐藏,移入又显示,首先是要判断窗体边界有没超过屏幕的边界线,反正像Q那样的,主要是通过鼠标的事件来实现,这个问题怎么写呢, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以屏幕左边为例:using System;using System.Windows.Forms;using System.Threading;using System.Runtime.InteropServices;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("user32.dll")] static extern bool GetCursorPos(out System.Drawing.Point lpPoint); private void timer1_Tick(object sender, EventArgs e) { if (this.Visible) { if (this.Left <= 0) { this.Hide(); } } else { System.Drawing.Point point = new System.Drawing.Point(); GetCursorPos(out point); if (point.X <= 5) { this.Visible = true; this.Left = 1; } } } private void Form1_Load(object sender, EventArgs e) { this.timer1.Interval = 100; this.timer1.Enabled = true; } }} 你应该还没看懂把,为什么不可以,先做判断,判断窗体边缘是否超过屏幕边界,写在鼠标MouseUp事件里面,还要有鼠标的其他事件,感觉代码是挺杂的 或者监视父窗口的鼠标事件另外,鼠标事件不会在父子窗口中同时触发,还有,如果已经产生了MouseDown在MouseUp未发生前,MouseMove可能会脱离当前窗口继续运行.这些问题基本上都不好处理. 我不是要隐藏的,比如说一个Div层,然后想通过鼠标移入他就显示层,离开就隐藏层,不是像上面那代码那样的 请问一个http通信的问题? 求助!!!!WINFORM程序运行不能再别的机器上运行(并非未装.net) 推荐本好书 C# 给我 我的Insert 语句错在哪里??? 在c#中用代码操作SQlite如何实现自增列值的改变 大家帮忙啊 ????!!!!! 求 《Visual C#数据库项目案例导航 》随书光盘代码 如何用C#实现多线程TCP协议的服务器端程序 winForm 如何将11111111 加密成G72IZGCCcBXl1gXtRCUiUQ==字符串 求水晶报表9.2企业版下载,要求是企业版, 如何从数据表读取一个字段到一个string里吗? toolStrip怎么只显示第一个按钮呢
以屏幕左边为例:using System;
using System.Windows.Forms;
using System.Threading;
using System.Runtime.InteropServices;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} [DllImport("user32.dll")]
static extern bool GetCursorPos(out System.Drawing.Point lpPoint); private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
if (this.Left <= 0)
{
this.Hide();
}
}
else
{
System.Drawing.Point point = new System.Drawing.Point();
GetCursorPos(out point);
if (point.X <= 5)
{
this.Visible = true;
this.Left = 1;
}
}
} private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Interval = 100;
this.timer1.Enabled = true;
}
}
}