如何在任务栏的顶部显示一个Windows窗体全屏?窗体、全屏、任务栏、如何在

由网友(烟虽伤肺不伤心)分享简介:我有一个需要全屏运行.NET Windows应用程序。当应用程序启动但在任务栏显示在主窗体的顶部,它只是通过点击或使用ALT + TAB激活表单时消失。表单的当前属性如下:I have a .net windows application that needs to run in full screen. When...

我有一个需要全屏运行.NET Windows应用程序。当应用程序启动但在任务栏显示在主窗体的顶部,它只是通过点击或使用ALT + TAB激活表单时消失。表单的当前属性如下:

I have a .net windows application that needs to run in full screen. When the application starts however the taskbar is shown on top of the main form and it only disappears when activating the form by clicking on it or using ALT-TAB. The form's current properties are as follow:

的WindowState = FormWindowState.Normal 在最顶层=正常 尺寸= 1024,768(这是机器它会被运行的屏幕分辨率) FormBorderStyle =无

我尝试添加在窗体加载以下几点但没有为我工作:

I've tried adding the followings on form load but none worked for me:

this.Focus(); (给予重点this.Focus属性后,始终为false) this.BringToFront(); this.TopMost = TRUE; (然而,这不会是理想中的我的情况) this.Bounds = Screen.PrimaryScreen.Bounds; this.Bounds = Screen.PrimaryScreen.Bounds;

有没有一种方法来在.NET做,否则我将不得不调用本机Windows方法,如果是这样一个code段将非常有AP preciated。

Is there a way to do it within .NET or would I have to invoke native windows methods and if so a code snippet would very much be appreciated.

非常感谢

推荐答案

我的简单的修复它竟然是调用窗体的启动()方法,因此没有必要使用最顶层(这是我的目标是在)。

My simple fix it turned out to be calling the form's Activate() method, so there's no need to use TopMost (which is what I was aiming at).

阅读全文

相关推荐

最新文章