放上一个Image就可以了,在Image的MouseMove事件里面处理边界就可以了
下面是一个例子

解决方案 »

  1.   

    Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        If (Image1.Left + x < 20) Or (Image1.Left + x >= Me.Width * 0.8) Then
            Exit Sub
        End If
        If Button = 1 Then
            Image1.Left = Image1.Left + x
            TreeWidthScale = Image1.Left / frmInfoDB.Width
            Call ResizeForm
        End If
    End Sub
    Private Sub ResizeForm()
        On Error Resume Next
        Call Image1.Move(Me.Width * TreeWidthScale, 0, SJSPACELENGTH, Me.Height - 400)
        Call trvInfoClass.Move(0, Image1.Top, Image1.Left, Image1.Height)
        Call Image2.Move(Image1.Left + Image1.Width, trvInfoClass.Height * ListHeightScale, Me.Width - Image1.Left - Image1.Width - 120, SJSPACELENGTH)
        Call lsvInfoCell.Move(Image2.Left, Image1.Top, Image2.Width, Image2.Top - Image1.Top)
        Call prlInfoProperty.Move(Image2.Left, Image2.Top + Image2.Height, Image2.Width, Image1.Height - Image2.Top - Image2.Height - 20)
    End Sub