读书人

至于隐藏任务栏

发布时间: 2011-12-25 23:21:20 作者: rapoo

关于隐藏任务栏

1 把
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
// this.TopMost = true;


}
可以实现我要得,隐藏任务栏

2 在页面中加个button

把上面得 this.FormBorderStyle = FormBorderStyle.None;
注销掉


onclick 中加
this.FormBorderStyle = FormBorderStyle.None;
点击后
不会实行慢屏.任务栏也还在



[解决办法]
我也 不的,一下
[解决办法]
ding
[解决办法]
Refresh()试试~
[解决办法]
在我这可以(OS Win 2003 VS2005)
[解决办法]
Suppose you want to remove the TitleBar or change the border style to prevent users from resizing your form. Unfortunately, VB only allows you to do this at design time. However, your form is just a window and the characteristics of a window are dictated by attributes called style and extended style bits.

http://www.thescarms.com/VBasic/windowstyle.asp
[解决办法]
帮顶一下
[解决办法]
U P
[解决办法]
try..

private void button2_Click(object sender, EventArgs e)
{
this.FormBorderStyle = FormBorderStyle.None;

this.WindowState = FormWindowState.Maximized;

}

即先BorderStyle设为None,后全屏..

顺序不要反了..
[解决办法]
我的系统也是VS2005+WinXp..
[解决办法]
this.WindowState = FormWindowState.Maximized;
得有这句!
[解决办法]
奇怪...

我这样测试是没有问题的..

private void button2_Click(object sender, EventArgs e)
{
this.FormBorderStyle = FormBorderStyle.None;

this.WindowState = FormWindowState.Maximized;

}

[解决办法]
我利用这个方法测试的时候,有点停滞,即先没有覆盖任务栏,但是大约一秒钟后,完全覆盖...
[解决办法]
奇怪,我这样用:
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;

反而不能覆盖任务栏...
[解决办法]
load把Explorer.exe杀了。。程序onclose再启动

[解决办法]
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace 经典测试
{
static class Program
{
[DllImport( "user32.dll ", EntryPoint = "FindWindow ")]
public static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName
);
[DllImport( "user32.dll ", EntryPoint = "ShowWindow ")]
public static extern int ShowWindow(
IntPtr hwnd,
int nCmdShow
);
public const int SW_HIDE = 0;
public const int SW_SHOW = 5;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
IntPtr hTaskBar = FindWindow( "Shell_TrayWnd ", " ");
ShowWindow(hTaskBar, SW_HIDE);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
ShowWindow(hTaskBar, SW_SHOW);
}
}
}

测试通过。你的窗体在设置成没有边框和全屏即可。
[解决办法]
按钮也可以啊。
IntPtr hTaskBar = Program.FindWindow( "Shell_TrayWnd ", " ");
Program.ShowWindow(hTaskBar, Program.SW_HIDE);
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;

读书人网 >C#

热点推荐