[求助]谁知道怎么让窗体满屏显示?
我想让程序一运行就满屏显示窗体,不显示任务栏,应该怎么办啊!
把Form的WindowState设置为2-最大化
楼主你说的任务栏是整条任务栏吧。
除了上面几位的共同建议,你还需要把窗口提升到其他窗口前面,需要用 API。
Option Explicit
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
Const HWND_TOPMOST = -1
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Private Sub Form_Load()
Me.Move 0, 0, Screen.Width, Screen.Height '不能用 WindowState = vbMaximized,否则无法置前窗口
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub