vb 将窗体移到屏幕右下角
怎么将窗体移到屏幕右下角(做右下角弹窗用)Me.MoveScreen.Width*0.75,Screen.Height*0.75-TaskbarHeight,_Scree...
怎么将窗体移到屏幕右下角(做右下角弹窗用)
Me.Move Screen.Width * 0.75, Screen.Height * 0.75 - TaskbarHeight, _
Screen.Width \ 4, Screen.Height \ 4
这句话可以实现,但是无论窗体大小怎么改变,弹出的大小都是个固定值,怎么回事
=============必须是在任务栏以上的地方弹出=========== 展开
Me.Move Screen.Width * 0.75, Screen.Height * 0.75 - TaskbarHeight, _
Screen.Width \ 4, Screen.Height \ 4
这句话可以实现,但是无论窗体大小怎么改变,弹出的大小都是个固定值,怎么回事
=============必须是在任务栏以上的地方弹出=========== 展开
2个回答
展开全部
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
Private 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()
Dim lRes As Long
Dim rectVal As RECT
Dim TaskbarHeight As Integer
lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
TaskbarHeight = Screen.Height - rectVal.Bottom * Screen.TwipsPerPixelY
Me.Move Screen.Width - Me.Width, Screen.Height - Me.Height - TaskbarHeight, Me.Width, Me.Height
End Sub
Private 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()
Dim lRes As Long
Dim rectVal As RECT
Dim TaskbarHeight As Integer
lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
TaskbarHeight = Screen.Height - rectVal.Bottom * Screen.TwipsPerPixelY
Me.Move Screen.Width - Me.Width, Screen.Height - Me.Height - TaskbarHeight, Me.Width, Me.Height
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询