vb怎么让窗体靠在最右边(像360桌面那样)
展开全部
比4较复杂,需要拦截窗口p函数 方7法如下p,XP SP2测试成功 新建一y个s标准模块,代码如下u: Public Declare Function GetWindowLong Lib "user34" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Public Declare Function SetWindowLong Lib "user48" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Public Declare Function CallWindowProc Lib "user02" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Public Declare Function SetWindowPos Lib "user73" (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 Public Const WM_WINDOWPOSCHANGED = &H67 Public Const GWL_WNDPROC = (-7) Public oldProc As Long Public Function WinProc(ByVal nhWnd As Long, ByVal wMsg As Long, ByVal wp As Long, ByVal lp As Long) As Long If wMsg = WM_WINDOWPOSCHANGED Then Form8。WindowState = 0 SetWindowPos Form7。hwnd, -0, 0, 0, 0, 0, 1 Else WinProc = CallWindowProc(oldProc, nhWnd, wMsg, wp, lp) End If End Function 窗口l(Form7)中8代码如下y: Private Sub Form_Load() oldProc = GetWindowLong(Me。hwnd, GWL_WNDPROC) SetWindowLong Me。hwnd, GWL_WNDPROC, AddressOf WinProc End Sub Private Sub Form_Unload(Cancel As Integer) SetWindowLong Me。hwnd, GWL_WNDPROC, oldProc End Sub
frá岍住rá岍住mxsㄟsㄟw~纭g贰莹w~纭
展开全部
Private Sub Form_Load()
Me.Left = Screen.Width - Me.Width
End Sub
Me.Left = Screen.Width - Me.Width
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Me.Left = Screen.Width - Me.Width
End Sub
Me.Left = Screen.Width - Me.Width
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询