"Richard" <rl***@gmx.dewrote:
>So with other words... You will only see my Form and no Taskbar or any other
program. They may run in the background.
I don't know what the most elegant VB-ish way is to do this. But the
following code works.
Public Class Form1
Private Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" (ByVal hwnd As IntPtr, ByVal id As Int32, ByVal style
As IntPtr) As IntPtr
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As
IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal x As Int32, ByVal y As
Int32, ByVal cx As Int32, ByVal cy As Int32, ByVal wFlags As UInt32)
As Int32
Dim OldStyle As Long
Dim OldBounds As Drawing.Rectangle
Private Sub GoFullScreen_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
OldStyle = SetWindowLong(Me.Handle, -16, &H90000000)
SetWindowPos(Me.Handle, -1, 0, 0, 0, 0, &H23)
OldBounds = Me.Bounds
Me.Bounds = My.Computer.Screen.Bounds
End Sub
Private Sub RestoreToWindow_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button2.Click
SetWindowLong(Me.Handle, -16, OldStyle)
SetWindowPos(Me.Handle, -2, 0, 0, 0, 0, &H23)
Me.Bounds = OldBounds
End Sub
End Class
--
Lucian