VB picturebox之类的控件,如何实现在运行时用鼠标调整其大小?

是不是要用到API啊?不太懂那些。希望有高手能指点迷津。解说越详细越好。ptionExplicitPrivateDeclareFunctionGetWindowLongL... 是不是要用到API啊?不太懂那些。
希望有高手能指点迷津。解说越详细越好。
ption Explicit
Private Declare Function GetWindowLong Lib "user32 " Alias "GetWindowLongA " (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32 " Alias "SetWindowLongA " (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32 " (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
Const GWL_STYLE = (-16)
Const WS_THICKFRAME = &H40000
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOZORDER = &H4
Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Const SWP_DRAWFRAME = SWP_FRAMECHANGED

Private Sub Form_Load()
SetWindowLong Picture1.hwnd, GWL_STYLE, _
GetWindowLong(Picture1.hwnd, GWL_STYLE) Or WS_THICKFRAME
SetWindowPos Picture1.hwnd, hwnd, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
End Sub
上面的代码是在网上找的,不清楚是什么意思,运行时说找不到
Dll入口点。
展开
 我来答
4xguys
2010-05-26 · TA获得超过241个赞
知道小有建树答主
回答量:423
采纳率:0%
帮助的人:0
展开全部
你亮哪引丛键如用的API多了一个空格渗启
"GetWindowLongA "
"SetWindowLongA "
去掉空格即可
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
tianqing20wen

2010-05-26 · TA获得超过2.4万个赞
知道大有可为答主
回答量:8226
采纳率:88%
帮助的人:5100万
展开全部
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "没铅user32" Alias "SetWindowLongA"枯运好 (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "悄宏user32" (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
Const GWL_STYLE = (-16)
Const WS_THICKFRAME = &H40000
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOZORDER = &H4
Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Const SWP_DRAWFRAME = SWP_FRAMECHANGED

Private Sub Form_Load()
SetWindowLong Picture1.hwnd, GWL_STYLE, _
GetWindowLong(Picture1.hwnd, GWL_STYLE) Or WS_THICKFRAME
SetWindowPos Picture1.hwnd, hwnd, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
End Sub
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式