C# 实现WinForm 全屏
来源:互联网 发布:单片机常用芯片51 编辑:程序博客网 时间:2024/05/27 01:37
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsFormsApplication3{ public partial class Form1 : Form { /// <summary> [DllImport("user32.dll")] public static extern int FindWindow( string lpClassName, // class name string lpWindowName // window name ); [DllImport("user32.dll")] public static extern bool SetWindowPos( int hWnd, // handle to window int hWndInsertAfter, // placement-order handle int X, // horizontal position int Y, // vertical position int cx, // width int cy, // height uint uFlags // window-positioning options ); /// <summary> /// 显示和隐藏鼠标指针. /// </summary> [DllImport("user32.dll", EntryPoint = "ShowCursor", CharSet = CharSet.Auto)] public static extern int ShowCursor(int bShow); const int SWP_NOSIZE = 0x1; const int SWP_NOMOVE = 0x2; const int SWP_NOZORDER = 0x4; const int SWP_NOREDRAW = 0x8; const int SWP_NOACTIVATE = 0x10; const int SWP_FRAMECHANGED = 0x20; //The frame changed:send WM_NCCALCSIZE const int SWP_SHOWWINDOW = 0x40; const int SWP_HIDEWINDOW = 0x80; const int SWP_NOCOPYBITS = 0x100; const int SWP_NOOWNERZORDER = 0x200; // Don't do owner Z ordering const int SWP_DRAWFRAME = SWP_FRAMECHANGED; const int SWP_NOREPOSITION = SWP_NOOWNERZORDER; // SetWindowPos() hwndInsertAfter values const int HWND_TOP = 0; const int HWND_BOTTOM = 1; const int HWND_TOPMOST = -1; const int HWND_NOTOPMOST = -2; private int hTaskBar; public Form1() { InitializeComponent(); this.WindowState = FormWindowState.Maximized; this.FormBorderStyle = FormBorderStyle.None; this.StartPosition = FormStartPosition.CenterScreen; //this.Size=SystemInformation.PrimaryMonitorSize; this.hTaskBar = FindWindow("Shell_traywnd", null); } private void Form1_Load(object sender, EventArgs e) { SetWindowPos(this.hTaskBar, HWND_BOTTOM, 0, 0, 0, 0, SWP_HIDEWINDOW); ShowCursor(0); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { SetWindowPos(this.hTaskBar, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW); } private void Form1_MouseHover(object sender, EventArgs e) { ShowCursor(1); } }}
- C# 实现WinForm 全屏
- C#实现WinForm窗口全屏显示
- WinForm实现全屏方法
- C# 实现Winform全屏后不遮挡任务栏,显示任务栏
- C# Winform 怎么让界面全屏显示
- C# 让控件全屏显示(WinForm)
- C# 让控件全屏显示(WinForm)
- c# winform实现拖拽控
- 实现 C# Winform截屏
- C# winform进度条实现
- c# winform 实现多线程
- C#实现winform天气预报
- C# 全屏截图实现方法
- C# WinForm 设置窗体在桌面区域全屏显示
- C# winform 实现MD5加密
- C#版winform实现UrlEncode
- C#版winform实现UrlEncode
- C#实现透明WinForm控件
- Forcal扩展动态库之 FcData
- Linux一些软件安装
- 解决方案、项目、程序集、命名空间
- 在系统框架下开发应用
- 在java中使用存储过程
- C# 实现WinForm 全屏
- XPath 初学者入门教程:XPath 语法
- bmp位图文件格式
- php页面zend加密乱码的解决办法
- UlturaWebGrid分页
- 在windows里面验测COM端口是否可用
- sharing
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(一)
- 博客作者应该学习的15个国外博客