hide main windows toolbar

G

Guest

Hello, we want to do a form on full screen using FormBorderStyle set to
FixedToolWindow and, in the form
load, seting the FormWindowState property to Maximized and seting TopMost
equal to True but ....

how can we do that the form were over the main windows bar too???

does it possible to hide or disable it while a run the applicacion that is a
full screen form ???

thanks a lot
 
G

Guest

You’ve got two options really, if you just want to hide the task bar, you can
simply use the following code:

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr
hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string
lpWindowName);

private const int SWP_HIDEWINDOW = 0x80;
private const int SWP_SHOWWINDOW = 0x40;

private void HideTaskBar()
{
IntPtr taskBar = FindWindow("Shell_TrayWnd", "");
SetWindowPos(taskBar, IntPtr.Zero, 0, 0, 0, 0, SWP_HIDEWINDOW);
}

public void ShowTaskBar()
{
IntPtr taskBar = FindWindow("Shell_TrayWnd", "");
SetWindowPos(taskBar, IntPtr.Zero, 0, 0, 0, 0, SWP_SHOWWINDOW);
}

This however may not be enough as you say you want to have your form take
over the entire screen... to do that, set your FormBorderStyle to none and
and WindowState to maximized ala:

this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;

To accomplish the same thing, all without the need for crazy hidings.

Brendan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top