473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Enable/Disable Taskbar

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
2 24759
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
2
by: HolaGoogle | last post by:
Can you please tell me the right way to do this?? it's realy important! thanks in advance... Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have...
3
by: Bob Bedford | last post by:
I've this code: function checkdate(FormSubmit){ alert(document.getElementById('Mois').value); if(eval(document.getElementById('Mois'))>0 && eval(document.getElementById('Annee'))>0){...
3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
0
by: Big John | last post by:
I have not been able to successfully code a toggle button to enable /disable a record filter on a form.... I have been able to put seperate a button that will enable a record filter but cannot get...
1
by: anthony | last post by:
Hi, I have a VB.NET application that runs on Embedded XP, the user can logon with password for different levels of right within the application. My boss wants the XP taskbar being hiden or...
2
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: -----------------------------...
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.