C# Winform 怎么让界面全屏显示
2010-08-09 13:05
483 查看
定义一个全局变量 int num=0;
private void 全屏显示ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.ResizeRedraw = false;
Point p = new Point();
p.X = 0; p.Y = 0;
int X = Screen.PrimaryScreen.Bounds.Width;
int Y = Screen.PrimaryScreen.Bounds.Height;
if ((num % 2) != 0)//判断奇数还是偶数
this.FormBorderStyle = FormBorderStyle.None;//奇数全屏
else
this.FormBorderStyle = FormBorderStyle.Sizable;//偶数恢复原样
this.Location = p;
this.Height = Y;
this.Width = X;
this.ResizeRedraw = true;
num++;
}
private void 全屏显示ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.ResizeRedraw = false;
Point p = new Point();
p.X = 0; p.Y = 0;
int X = Screen.PrimaryScreen.Bounds.Width;
int Y = Screen.PrimaryScreen.Bounds.Height;
if ((num % 2) != 0)//判断奇数还是偶数
this.FormBorderStyle = FormBorderStyle.None;//奇数全屏
else
this.FormBorderStyle = FormBorderStyle.Sizable;//偶数恢复原样
this.Location = p;
this.Height = Y;
this.Width = X;
this.ResizeRedraw = true;
num++;
}
相关文章推荐
- C# Winform 怎么让按钮在Panel里居中显示
- C# Winform 全屏不显示任务栏
- C#实现WinForm窗口全屏显示
- C#winform界面中如何显示当前时间,是用lable控件实现
- C#:控制WinForm界面的显示
- C# 让控件全屏显示(WinForm)
- C# 让控件全屏显示(WinForm)
- C# 实现Winform全屏后不遮挡任务栏,显示任务栏
- C# WinForm中 让控件全屏显示的实现代码
- C# WinForm 设置窗体在桌面区域全屏显示
- C# 让控件全屏显示(WinForm)
- C# winform 窗体怎么隐藏标题栏,不显示标题栏
- C# 让控件全屏显示(WinForm)
- C# Winform 怎么让按钮在Panel里居中显示
- C#程序双击运行之后,界面不显示,但是在任务管理器有进程(一个winform找bug之旅)
- c# Winform 开发分屏显示应用程序
- C# 全屏坐标及区域坐标获取。自定义光标及系统光标描边捕捉显示。
- C#winform 实现 QQ2009游戏界面
- c# winform 怎么给程序的按钮上也加上小盾牌图标