vb怎么让窗体靠在最右边(像360桌面那样)

 我来答
手机用户35580
2011-10-29 · 贡献了超过138个回答
知道答主
回答量:138
采纳率:0%
帮助的人:59.7万
展开全部
比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~纭
zx001z7d53
2011-10-29 · TA获得超过2万个赞
知道大有可为答主
回答量:2.4万
采纳率:52%
帮助的人:5698万
展开全部
Private Sub Form_Load()
Me.Left = Screen.Width - Me.Width
End Sub
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
syx54
2011-10-29 · TA获得超过7379个赞
知道大有可为答主
回答量:6567
采纳率:83%
帮助的人:2769万
展开全部
Private Sub Form_Load()
Me.Left = Screen.Width - Me.Width
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式