By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,563 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,563 IT Pros & Developers. It's quick & easy.

Enable/Disable Taskbar

P: n/a
I know I can fill the screen in VB.NET by starting my window maximized and
without a border.

My question is; in VB.NET is there a way to enable/disable the taskbar much
like doing the "always on top" feature? I would like my program to
automatically "hide" the taskbar when running.

Thanks.

John
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
XP is the operating system to enable/disable the taskbar, but if you want to
hide it then follow these steps:

Start a new Windows application & add two button (Button1 & Button2
respectively)

Button1 will be show Taskbar
Button2 will be hide the Taskbar

Declarations:

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal
hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx
As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Now, doule-click Button1 & add the following code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

Lastly, double-click Button2 & paste in this code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

Run the program & click button 2 to hide the Taskbar & button1 to show it.

Remember, to show the Taskbar on form closing or you'll have no Taskbar.

I hope this helps.

"JohnProgrammer" wrote:
I know I can fill the screen in VB.NET by starting my window maximized and
without a border.

My question is; in VB.NET is there a way to enable/disable the taskbar much
like doing the "always on top" feature? I would like my program to
automatically "hide" the taskbar when running.

Thanks.

John

Nov 21 '05 #2

P: n/a
Excellent, that was just the ticket! Many thanks.

John

"Crouchie1998" wrote:
XP is the operating system to enable/disable the taskbar, but if you want to
hide it then follow these steps:

Start a new Windows application & add two button (Button1 & Button2
respectively)

Button1 will be show Taskbar
Button2 will be hide the Taskbar

Declarations:

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal
hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx
As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Now, doule-click Button1 & add the following code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

Lastly, double-click Button2 & paste in this code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

Run the program & click button 2 to hide the Taskbar & button1 to show it.

Remember, to show the Taskbar on form closing or you'll have no Taskbar.

I hope this helps.

"JohnProgrammer" wrote:
I know I can fill the screen in VB.NET by starting my window maximized and
without a border.

My question is; in VB.NET is there a way to enable/disable the taskbar much
like doing the "always on top" feature? I would like my program to
automatically "hide" the taskbar when running.

Thanks.

John

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.