百度了,看到有说调用API的,还有设置form.size的。对于API这个我不怎么懂,有高手发下带注释的代码吗?
解决方案 »
- C# dll 如何编译到exe里面去。
- 求助!vs2010 express 如何 找到 source control 以便连接 代码版本管理软件
- 请教一个类的问题
- asp.net里 怎么让点击找不到的页的时候 转向友情提示页面
- 找到关于EnumChildWindows的代码,但是不会用,谁能帮帮我
- 我想短期内学会.net,应该如何做呢?
- 关于事件委托问题
- 继承之猫和狗
- 小妹剛學C#,請問C#自動生成代碼"/// <summary>"有什麼作用啊?
- 怎么用word文件的数据流设置Word.Document,谢谢
- 求个LINQ看看可能求到么?关于两个dataset合并查询
- 如何处理让用户调用自己写的方法?
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;namespace GlobalTechnologyInc.SnmpProject.CustomClass
{
/// <summary>
/// Selected Win AI Function Calls
/// </summary> class WindowsFullScreenApi
{
[DllImport("user32.dll", EntryPoint = "GetSystemMetrics")]
public static extern int GetSystemMetrics(int which); [DllImport("user32.dll")]
public static extern void
SetWindowPos(IntPtr hwnd, IntPtr hwndInsertAfter,
int X, int Y, int width, int height, uint flags); private const int SM_CXSCREEN = 0;
private const int SM_CYSCREEN = 1;
private static IntPtr HWND_TOP = IntPtr.Zero;
private const int SWP_SHOWWINDOW = 64; // 0x0040 public static int ScreenX
{
get { return GetSystemMetrics(SM_CXSCREEN); }
} public static int ScreenY
{
get { return GetSystemMetrics(SM_CYSCREEN); }
} public static void SetWinFullScreen(IntPtr hwnd)
{
SetWindowPos(hwnd, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW);
}
}
}
tempWindowState = this.WindowState;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.SetVisibleCore(true);恢复
this.FormBorderStyle = FormBorderStyle.Sizable;
this.WindowState = tempWindowState;