473,395 Members | 1,936 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,395 software developers and data experts.

.Net GURU Wanted ---> TaskBar Hide Show & ScrollBar size

Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?
Nov 19 '05 #1
5 8494
"spielmann" <e9******@eif.ch> schrieb
How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?

Without DLL?? Everything is in a DLL.

There's not built-in method in the .NET framework. You can only retrieve
some values from System.Windows.Forms.SystemInformation

You have to use pInvoke (calling API functions) to change the settings. See
the platform SDK for details.
--
Armin

Nov 19 '05 #2
Hello,

"spielmann" <e9******@eif.ch> schrieb:
How can we hide and show the taskbar without dll on vb.net?
http://www.activevb.de/tipps/vb6tipps/tipp0003.html

Notice that the sample is written in VB6, in order to use it with VB .NET,
you must replace all "As Long"s with "As Int32"s.

Without DLL? I do not understand...
How can we set the scrollbar size without dll on vb.net?


This should be done in the dialogs provided by the operating system.

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 19 '05 #3
In VB6 you could do this
put in module: (change all types in declare to vb.net equivalents)

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TRANSPARENT = &H20&
Public Const WS_EX_NOPARENTNOTIFY = &H4&
Global hwnd1 As Long

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

Global Const SWP_SHOWWINDOW = &H40
Global Const SWP_HIDEWINDOW = &H80

Now put this in your form or class whatever

'Default Property Values:
Const m_def_HideTaskBar = 0

'Property Variables:
Dim m_HideTaskBar As Boolean

Private Sub HideTheTaskBar(HideIt As Boolean)
hwnd1 = FindWindow("Shell_traywnd", "")
If HideIt Then
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Else
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End If
End Sub

Private Sub Image1_Click()
HideTheTaskBar (HideTaskBar)
End Sub

Public Property Get HideTaskBar() As Boolean
HideTaskBar = m_HideTaskBar
End Property

Public Property Let HideTaskBar(ByVal New_HideTaskBar As Boolean)
m_HideTaskBar = New_HideTaskBar
HideTheTaskBar New_HideTaskBar
PropertyChanged "HideTaskBar"
End Property

Private Sub Form_Load()
m_HideTaskBar = m_def_HideTaskBar
End Sub

Take this code and modify a bit for .NET and it will work.
be sure to declare HWND variables as required and change declares as you
should.

HTH

Shane Story
"spielmann" <e9******@eif.ch> wrote in message
news:a2**************************@posting.google.c om...
Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?

Nov 19 '05 #4
In VB6 you could do this
put in module: (change all types in declare to vb.net equivalents)

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TRANSPARENT = &H20&
Public Const WS_EX_NOPARENTNOTIFY = &H4&
Global hwnd1 As Long

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

Global Const SWP_SHOWWINDOW = &H40
Global Const SWP_HIDEWINDOW = &H80

Now put this in your form or class whatever

'Default Property Values:
Const m_def_HideTaskBar = 0

'Property Variables:
Dim m_HideTaskBar As Boolean

Private Sub HideTheTaskBar(HideIt As Boolean)
hwnd1 = FindWindow("Shell_traywnd", "")
If HideIt Then
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Else
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End If
End Sub

Private Sub Image1_Click()
HideTheTaskBar (HideTaskBar)
End Sub

Public Property Get HideTaskBar() As Boolean
HideTaskBar = m_HideTaskBar
End Property

Public Property Let HideTaskBar(ByVal New_HideTaskBar As Boolean)
m_HideTaskBar = New_HideTaskBar
HideTheTaskBar New_HideTaskBar
PropertyChanged "HideTaskBar"
End Property

Private Sub Form_Load()
m_HideTaskBar = m_def_HideTaskBar
End Sub

Take this code and modify a bit for .NET and it will work.
be sure to declare HWND variables as required and change declares as you
should.

HTH

Shane Story
"spielmann" <e9******@eif.ch> wrote in message
news:a2**************************@posting.google.c om...
Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?
"spielmann" <e9******@eif.ch> wrote in message
news:a2**************************@posting.google.c om... Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?

Nov 19 '05 #5
Thx but I want something like this

System.Windows.Forms.SystemInformation.VerticalScr ollBarWidth

I won't use a dll, I will use vb.net object only, like this it will be
transparent for me.

but thx
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Robb Gilmore | last post by:
Hello, This is probably an easy one, but I have not been able to figure it out so far. I have a tab control on a windows forms app. Depending on some business logic, I need to hide/show some...
4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
2
by: carmen | last post by:
I need to have in a form a listbox with a big scrollbar (I'm working for a touchscreen). As the scrollbar that the listbox has is small, I put a listbox withou scroll and a scrollbar independent....
1
by: Norman | last post by:
Hello All, I have developed the ASP.Net application using .Net 1.1. I want to get one section of the page under hide/show feauture. That means when the user clicks on display I want to display all...
3
by: spielmann | last post by:
Hello I want to change the scrollbar size of windows, How can I do that with vb.net I have find this in VB6 but how can we convert simply this code. thx
4
by: Sakharam Phapale | last post by:
Hi All, I have installed VS .NET 2002 on my machine. I have checked both Vertical scrollbar and Horizontal Scrollbar options, in Tools -> Options-> Text Editor-> General-> Vertical Scrollbar...
5
by: Philippe Martin | last post by:
Hi, Thanks to the NG, I got the script hereunder working. 1) I am not certain that the call to convert does much (checking the doc) 2) Can this be improved as far as the final image size in...
0
by: jazeelkm | last post by:
hi, i am a beginer in the world of C# 1. I want to hide the vertical scrollbar of a listbox . In properties i can hide the horizontal scrollbar , but there s no option for vertical scroll...
11
by: dmorand | last post by:
I'm having some trouble with my javascript which is supposed to hide/show a div element. I have to click on the link twice before it'll hide. I can't seem to figure out why the first click does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.