Winform窗体实现类似停靠在屏幕边缘时自动隐藏的功能
2009-08-01 16:02
696 查看
该功能主要用到了计时器和Frm_LocationChanged事件。代码如下;
private void FrmLocation_Load(object sender, EventArgs e)
private void StopRectTimer_Tick(object sender, EventArgs e)
private void FrmLocation_LocationChanged(object sender, EventArgs e)
{
if (this.Top <= 0)
{
this.StopDock = AnchorStyles.Top;
}
else if (this.Bottom >= Screen.PrimaryScreen.Bounds.Height)
{
this.StopDock = AnchorStyles.Bottom;
}
else if (this.Left <= 0)
{
this.StopDock = AnchorStyles.Left;
}
else if (this.Left >= Screen.PrimaryScreen.Bounds.Width - this.Width)
{
this.StopDock = AnchorStyles.Right;
}
else
{
this.StopDock = AnchorStyles.None;
}
}
private void FrmLocation_Load(object sender, EventArgs e)
private void StopRectTimer_Tick(object sender, EventArgs e)
private void FrmLocation_LocationChanged(object sender, EventArgs e)
{
if (this.Top <= 0)
{
this.StopDock = AnchorStyles.Top;
}
else if (this.Bottom >= Screen.PrimaryScreen.Bounds.Height)
{
this.StopDock = AnchorStyles.Bottom;
}
else if (this.Left <= 0)
{
this.StopDock = AnchorStyles.Left;
}
else if (this.Left >= Screen.PrimaryScreen.Bounds.Width - this.Width)
{
this.StopDock = AnchorStyles.Right;
}
else
{
this.StopDock = AnchorStyles.None;
}
}
相关文章推荐
- Winform窗体实现类似停靠在屏幕边缘时自动隐藏的功能
- Winform窗体实现类似停靠在屏幕边缘时自动隐藏的功能 .doc
- c# 实现窗体拖到屏幕边缘自动隐藏
- winform-实现类似QQ停靠桌面上边缘隐藏的效果
- WinForm,窗体靠近屏幕边缘自动隐藏
- winform实现任务栏隐藏、通知栏图标及右键、类似QQ隐藏窗体等功能
- c# 实现窗体拖到屏幕边缘自动隐藏
- [仿QQ聊天工具系列一]关于停靠屏幕边缘时自动隐藏窗体的研究
- C# 实现类似QQ的窗体在桌面边缘停靠和隐藏
- 窗口在屏幕边缘自动隐藏的实现(动态收缩与动态弹出)(转)
- C# 窗体靠近屏幕边缘自动隐藏*学习(类似于QQ)
- 怎样实现跟qq一样停靠在桌面边缘时,自动隐藏
- Qt实现窗体在显示屏旁边自动隐藏(类似QQ)
- 用C#代码实现类似QQ窗体的“上、左、右”停靠功能【转】
- WinForm窗体屏幕边缘停靠
- WinForm实现类似QQ停靠,显示隐藏过程添加特效效果
- WinForm实现类似QQ停靠,显示隐藏过程添加特效效果
- C# 窗体靠近屏幕边缘自动隐藏*学习(类似于QQ)
- ThinkPad机型Hotkey影响QQ停靠在桌面边缘时自动隐藏功能