我的代码如下:
Private Sub Form_Load()
With Me
.Left = 0
.Top = 0
.Height = Screen.Height
.Width = Screen.Width
End With
End Sub
通过以上代码,本机可以显示任务栏,但是拿到别的机器上窗体却把任务栏也遮住了,请教如何修改?
Private Sub Form_Load()
With Me
.Left = 0
.Top = 0
.Height = Screen.Height
.Width = Screen.Width
End With
End Sub
通过以上代码,本机可以显示任务栏,但是拿到别的机器上窗体却把任务栏也遮住了,请教如何修改?
.Height = Screen.Height-任务栏.height
或者用api查一下任务栏状态再进行判断
请说得具体一点好吗?
'声明
Private Const SPI_GETWORKAREA = 48
Private Declare Function SystemParametersInfo& Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long,ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type'取得屏幕可利用区域,然后放置窗体。
Dim ScreenWidth&, ScreenHeight&, ScreenLeft&, ScreenTop&
Dim DesktopArea As RECT
Call SystemParametersInfo (SPI_GETWORKAREA, 0, DesktopArea, 0)
ScreenHeight = (DesktopArea.Bottom - DesktopArea.Top) * Screen.TwipsPerPixelY
ScreenWidth = (DesktopArea.Right - DesktopArea.Left) * Screen.TwipsPerPixelX
ScreenLeft = DesktopArea.Left * Screen.TwipsPerPixelX
ScreenTop = DesktopArea.Top * Screen.TwipsPerPixelY
Me.Move ScreenLeft,ScreenTop,ScreenWidth,ScreenHeight