程序代码: | [ 复制代码 ] |
Option Explicit
'http://www.cnng.net
'石陆软件屋
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Const SPI_GETWORKAREA = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Me.Width = Screen.Width: Me.Height = Screen.Height - GetTaskbarHeight() * 15
Me.Move 0, 0
End Sub
Public Function GetTaskbarHeight() As Integer
Dim lRes As Long
Dim rectVal As RECT
lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
GetTaskbarHeight = (Screen.Height / Screen.TwipsPerPixelX) - rectVal.Bottom
End Function
'http://www.cnng.net
'石陆软件屋
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Const SPI_GETWORKAREA = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Me.Width = Screen.Width: Me.Height = Screen.Height - GetTaskbarHeight() * 15
Me.Move 0, 0
End Sub
Public Function GetTaskbarHeight() As Integer
Dim lRes As Long
Dim rectVal As RECT
lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
GetTaskbarHeight = (Screen.Height / Screen.TwipsPerPixelX) - rectVal.Bottom
End Function
相关链接:vb | 计算任务栏高度
[本日志由 admin 于 2013-11-01 10:52 PM 编辑]
引用通告地址 (0):
http://www.cnng.net/blog/trackback.asp?tbID=42
http://www.cnng.net/blog/trackback.asp?tbID=42&CP=GBK
http://www.cnng.net/blog/trackback.asp?tbID=42
http://www.cnng.net/blog/trackback.asp?tbID=42&CP=GBK