重回博客园
2014-04-03 08:57
120 查看
暂别AS3生涯,重回C#,今天开始整理头绪写个随笔。
关于Winform全屏的问题,网上的资料,都是差不多,将Window窗口最大化,然后去除边框和任务栏
关于Winform全屏的问题,网上的资料,都是差不多,将Window窗口最大化,然后去除边框和任务栏
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; // Important! namespace FullScreenExample { public partial class Form1 : Form { [DllImport("user32.dll")] private static extern int FindWindow(string lpszClassName, string lpszWindowName); [DllImport("user32.dll")] private static extern int ShowWindow(int hWnd, int nCmdShow); private const int SW_HIDE = 0; private const int SW_SHOW = 1; private void full_maximize(object sender, EventArgs e) { //隐藏任务栏 int hWnd = FindWindow("Shell_TrayWnd", ""); ShowWindow(hWnd, SW_HIDE); FormBorderStyle = FormBorderStyle.None; this.Location = new Point(0, 0); this.WindowState = FormWindowState.Maximized; } public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { full_maximize(sender, e); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { int hwnd = FindWindow("Shell_TrayWnd", ""); ShowWindow(hwnd, SW_SHOW); } }
相关文章推荐
- 用python抓取oj题目(0)——重回战场 - duoduo3_69 - 博客园
- jquery1.9更新-持续更新-重回博客园
- 重回博客园有感
- 重回博客园继续我的 GUI库
- 告别博客园,重回CSDN。
- 重回博客园
- 重回博客园,发帖庆祝一下~
- 重回博客园
- 博客园吐糟
- ios学习转载博客园
- 如何统计博客园的个人博客访问量
- 将qq空间的说说同步至博客园系列之通过Cookie和qq空间g_tk参数取得空间数据(2)
- PageRank 计算博客园用户排名
- 博客园用户体验
- pure css做的手机版博客园(我自己博客)
- 从这里开始我的博客园
- 利用Haproxy给MySQL Cluster做负载均衡 - wang1988ming - 博客园
- mvc3升级mvc4的方法记录. - 棋怜 - 博客园
- 博客园计算园龄不正确,请管理员确认
- 博客园左侧装饰