求段代码

来源:百度知道 编辑:UC知道 时间:2024/06/21 08:21:23
求段 代码
要用 .net 编写一段 全屏代码
在任务前,全屏显示
给出 VB、C# 2005 的代码
谢了您哪!

//在你要全屏的窗体内添加一个按钮,然后加入如下代码:
//这里关键是用到了System.Screen类,有关详细的使用方式可以查看一下MSDN

private void button1_Click(object sender, System.EventArgs e)
{
this.Location = new Point(0,0);
this.Size = Screen.PrimaryScreen.Bounds.Size;
this.TopMost = true;
}