如何实现象QQ那般隐藏的窗体
来源:互联网 发布:仿淘宝网站模板 编辑:程序博客网 时间:2024/04/28 08:27
private void Form1_Load(object sender, System.EventArgs e)
{
System.Windows.Forms.Timer StopRectTimer = new System.Windows.Forms.Timer();
StopRectTimer.Tick +=new EventHandler(StopRectTimer_Tick);
StopRectTimer.Interval = 100;
StopRectTimer.Enabled = true;
}
private void StopRectTimer_Tick(object sender, EventArgs e)
{
if(this.Bounds.Contains(Cursor.Position))
{
switch(this.StopAanhor)
{
case AnchorStyles.Top:
this.Location = new Point(this.Location.X,0);
break;
case AnchorStyles.Left:
this.Location = new Point(0,this.Location.Y);
break;
case AnchorStyles.Right:
this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Width,this.Location.Y);
break;
}
}
else
{
switch(this.StopAanhor)
{
case AnchorStyles.Top:
this.Location = new Point(this.Location.X,(this.Height-2)*(-1));
break;
case AnchorStyles.Left:
this.Location = new Point((-1)*(this.Width-2),this.Location.Y);
break;
case AnchorStyles.Right:
this.Location = new Point(Screen.PrimaryScreen.Bounds.Width-2,this.Location.Y);
break;
}
}
}
internal AnchorStyles StopAanhor = AnchorStyles.None;
private void mStopAnhor()
{
if(this.Top<=0)
{
StopAanhor = AnchorStyles.Top;
}
else if(this.Left<=0 )
{
StopAanhor = AnchorStyles.Left;
}
else if(this.Left>=Screen.PrimaryScreen.Bounds.Width-this.Width)
{
StopAanhor = AnchorStyles.Right;
}
else
{
StopAanhor = AnchorStyles.None;
}
}
private void Form1_LocationChanged(object sender, System.EventArgs e)
{
this.mStopAnhor();
}
- 如何实现象QQ那般隐藏的窗体
- 象QQ窗体一样隐藏
- swing 实现象QQ一样自动隐藏
- [VB.NET]请问类似QQ窗体靠边自动隐藏的效果如何实现?????
- C#实现类似QQ的隐藏浮动窗体、消息闪动
- Delphi下实现QQ窗体自动隐藏
- C#实现QQ窗体隐藏(第一版)
- C# 实现像QQ一样隐藏窗体
- 如何实现WinForms窗体隐藏
- 如何实现WinForms窗体隐藏
- Java实现窗体隐藏,功能类似于QQ窗口自动隐藏
- C#如何实现类似QQ那样靠边隐藏的功能
- C# 实现类似QQ的窗体在桌面边缘停靠和隐藏
- 如何实现类QQ登录窗体的功能:登录窗体验证通过后关闭,打
- 模拟QQ自动隐藏窗体
- 让你的QQ窗体变透明(隐藏API使用方法)
- C++语言 如QQ般隐藏的窗体
- 类似QQ的抖动窗体的实现
- 用directshow 实现抓图遇到的问题
- AJAX是什么
- 「机箱」Tt Bach巴赫机箱 (VB8001BNS黑/VB8001SNS银白)
- JMS消息详解
- 网页插入real播放器多文件可选择播放的代码 2006-6-9-1
- 如何实现象QQ那般隐藏的窗体
- 不能落后于时代--我的博客起点
- 「机箱」 Tt 海啸系列
- “说服自己+调整自己”、香港人与大陆人
- C++ main()函数及其参数
- 「机箱」酷冷至尊 影音先锋 250
- google 电子表格体验
- 「机箱」富士康 TL3-882
- 非常周末吴宗宪受辱