移动没有标题的窗体
[入库:2005年8月18日] [更新:2007年3月24日]
|
|
我们一般是用鼠标按住窗口的标题栏,然后移动窗口,当窗口没有标题栏时,我们可以用下面的方法来移动窗口:
在 bas 文件中声明:
declare function releasecapture lib "user32" () as long
declare function sendmessage lib "user32" _
alias "sendmessagea" ( _
byval hwnd as long, byval wmsg as long, _
byval wparam as long, lparam as any) as long
public const htcaption = 2
public const wm_nclbuttondown = &ha1
然后,在 form_mousedown 事件中:
private sub form_mousedown(button as integer, shift as integer, x as single, y as single)
releasecapture
sendmessage hwnd, wm_nclbuttondown, htcaption, 0&
end sub
|
本文关键:移动没有标题的窗体
本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)