# Re: 请问如何用 VB 写一个 Full screen 的 form ？

Posted by cww on February 09, 1999 at 11:41:01:

In Reply to: Re: 请问如何用 VB 写一个 Full screen 的 form ？ posted by David Wong on February 09, 1999 at 08:54:54:

若是我，我会在Design time 设定Form.Moveable = False
而后Form_Load时设定form的大小为萤幕的大小，并且左上
角在(0,0)的位置，最后设定它成TopMost的Form，如此
可盖住TaskBar，而需要时，TaskBar可再Show出(按Ctrl-Esc)
，而Form只要再Setfocus便会再度盖掉TaskBar

Const FLAG = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const HWND_TOP = 0
Const HWND_BOTTOM = 1
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 Sub Form_Load()
Me.Move 0, 0, Screen.Width, Screen.Height
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAG)
End Sub

Private Sub Command2_Click()
Call SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAG)
End Sub

Follow Ups:

- Re: 请问如何用 VB 写一个 Full screen 的 form ？ David Wong 09:31:55 2/19/99 (0)