气动电磁阀与气缸关系:求解释下面vb语言编写的模块的功能,知道多少就说多少好了

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 22:17:11
用户控件
Usercontrol1
Dim a As Long

Dim UpObj As Control
Dim DownObj As Control
Dim UpObj_min_height As Long
Dim DownObj_min_height As Long

Public Sub set_UpObj(xx As Object, min_height As Long)
Set UpObj = xx
UpObj_min_height = min_height
End Sub

Public Sub set_DownObj(xx As Object, min_height As Long)
Set DownObj = xx
DownObj_min_height = min_height
End Sub

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
a = Y
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'

End Sub

Private Sub Frame1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 0 Then Exit Sub

If UpObj.Height + Y - a <= UpObj_min_height Then Exit Sub
If DownObj.Height - (Y - a) <= DownObj_min_height Then Exit Sub

Extender.Top = Extender.Top + Y - a
UpObj.Height = UpObj.Height + Y - a
DownObj.Height = DownObj.Height - (Y - a)
DownObj.Top = DownObj.Top + Y - a
End Sub

Private Sub UserControl_Resize()
Frame1.Width = Width
Frame1.Height = 100
UserControl.Height = 75

End Sub

应该是一段实现控件拖放的代码,使控件可以用鼠标在程序界面上拖动
不过代码似乎不完整