到下面的帖子去找http://expert.csdn.net/Expert/topic/1555/1555609.xml?temp=.9091608

解决方案 »

  1.   

    不对阿
    我用的是TEXT控件
    怎么没出发MOUCE-UP事件?
      

  2.   

    text1.width=XXXX
    text1.height=XXXXX
      

  3.   

    TextBox怎么会没有MouseUP事件呢?
    Public isMove As Boolean
    Public bX, bY As LongPrivate Sub Form_Load()
    isMove = False
    End SubPrivate Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
       isMove = True
       bX = X
       bY = Y
    End If
    End SubPrivate Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 And isMove Then
       Text1.Move X + Text1.Left - bX, Y + Text1.Top - bY
    End If
    End SubPrivate Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    isMove = False
    End Sub
      

  4.   

    这是一个改变控件大小的例子,我用的是PictureBoxPublic bX, bY As Long
    Public bW, bH As LongPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.MousePointer = 0
    End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 And Me.MousePointer = 8 Then
       bX = X
       bY = Y
       bW = Picture1.Width
       bH = Picture1.Height
    End If
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 0 Then
       If X > Picture1.Width - 150 And X < Picture1.Width + 50 And Y > Picture1.Height - 150 And Y < Picture1.Height + 50 Then
          Me.MousePointer = 8
       Else
          Me.MousePointer = 0
       End If
    ElseIf Button = 1 Then
       If bW + X - bX <= 0 Or bH + Y - bY <= 0 Then Exit Sub
       Picture1.Width = bW + X - bX
       Picture1.Height = bH + Y - bY
    End If
    End Sub