当前位置:编程学习 > VB >>

vb6中无边框窗口拖动问题

我想设计一个可以拖动的日历,使用了Microsoft日历控件11.0,去掉了所在窗体的边框,添加了关闭按钮。如何能实现拖动红框框内的部分使日历移动?
补充:
		
追问:我太笨,不知道咋用。麻烦您说详细点。

答案:移动无边框的窗口

 

'-----------------------------------托动窗口
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Declare Sub ReleaseCapture Lib "user32" ()
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

 

Private Function moveform()
    Dim lngReturnValue As Long
    Call ReleaseCapture
    lngReturnValue = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End Function

 

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Button = 1 Then
    moveform
  End If
End Sub

上一个:求VB或易语言的入门教程!
下一个:如何使用VB制作自动登陆器?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,