Thumbs uphelp with resize ing

Posts 18 of 8 · Page 1 of 1
help with resizing form?
hello i am making a web browser and i am givving a button this function
Code:
FormBorderStyle = Windows.Forms.FormBorderStyle.None
        WindowState = FormWindowState.Maximized
which will work as full screen mode

how do i make it so if i click the button again it restore it to its normal size
Code:
FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
        WindowState = FormWindowState.Normal


also

does any one know how to hide the taskbar along with the taskbar????
Assign a boolean variable maximized. If maximized is true and the button gets pressed, restore to normal size. If not and the button is pressed, maximize the form.

"does any one know how to hide the taskbar along with the taskbar????"
What?
You need to toggle the window state by using the IF statement. Here's how you can do it:

Code:
If Me.WindowState = FormWindowState.Maximized Then
            Me.WindowState = FormWindowState.Normal
        Else
            Me.WindowState = FormWindowState.Maximized
        End If
For hiding your program from the taskbar, use the following command:

Code:
Me.ShowInTaskbar = False
Where me is your current form. You can change it with whatever Form you like. To show the form in the taskbar, simply set the value to True.

Hope this helps
thanks you flame the first part worked flawlessly but for the second one i meant to say that how do i hide the taskbar not my icon in the taskbar but the taskbar itself
Quote Originally Posted by hopefordope View Post
thanks you flame the first part worked flawlessly but for the second one i meant to say that how do i hide the taskbar not my icon in the taskbar but the taskbar itself
change form border style to "none"
Quote Originally Posted by hopefordope View Post
thanks you flame the first part worked flawlessly but for the second one i meant to say that how do i hide the taskbar not my icon in the taskbar but the taskbar itself
Hmm.. I once did a side bar application in which I hide the task bar. Following is the code for the hiding, but unfortunately it works on XP and Vista only. Right now I've 7 installed so, I can't check it. Anyways, here's the MSDN standard API calls to hide and show the task bar:

■ First add these declarations:


Private 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
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"( ByVal lpClassName As String , ByVal lpWindowName As String ) As Long
Const SWPHIDEWINDOW = & H80
Const SWPSHOWWINDOW = & H40
Dim TaskBarHwnd As Long

Then on Form's Load event, add the following line:

TaskBarHwnd = FindWindow( "Shell_traywnd", "")

Then add the following sub-procedures that call show and hide the task bar:

Sub HideTaskbar()
Call SetWindowPos(TaskBarHwnd,0 & ,0 & ,0 & ,0 & ,0 & ,SWPHIDEWINDOW)
End Sub

Sub ShowTaskbar()
Call SetWindowPos(TaskBarHwnd,0 & ,0 & ,0 & ,0 & ,0 & ,SWPSHOWWINDOW)
End Sub

Finally, call these subs as required !!!

Hope this helps !!
So you mean literally remove the taskbar?
yeah but it temporarily hides and it can be restored
Posts 18 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?