如题,请高手指教!

解决方案 »

  1.   

    我有。
    MSN:[email protected]
      

  2.   

    这时以前给一位csdner做的在picturebox里选择框的源码,楼主自己改改吧:Dim x1 As Long
    Dim y1 As Long
    Dim x2 As Long
    Dim y2 As Long
    Dim x3 As Long
    Dim y3 As Long
    Dim w As Long
    Dim h As Long
    Dim t As Long
    Dim l As Long
    Dim DOING As Boolean
    Dim going As Boolean
    Private Sub Form_Load()With Shape2(0)
    .FillStyle = 0
    .Shape = 0
    .Height = 80
    .Width = 80
    .Visible = False
    End With
    For i = 1 To 8
    If i <> 4 Then
    Load Shape2(i)
    End If
    NextWith Shape1
    .Visible = False
    .Shape = 0
    .BorderStyle = 3
    End WithEnd Sub
    Private Sub Picture1_DblClick()
    Shape1.Visible = False
    For i = 0 To 8
    If i <> 4 Then
                Shape2(i).Visible = False
    End If
    Next
    End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
    x1 = X
    y1 = Y
    DOING = True
    ElseIf Button = 2 Then
    x2 = X
    y2 = Y
    w = Shape1.Width
    h = Shape1.Height
    ElseIf Button = 3 Then
    x3 = X
    y3 = Y
    t = Shape1.Top
    l = Shape1.Left
    going = True
    End If
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
    If DOING = True Then
    If X >= x1 And Y >= y1 Then
    Shape1.Visible = True
    Shape1.Top = y1
    Shape1.Left = x1
    ElseIf X > x1 And Y < y1 Then
    Shape1.Top = Y
    ElseIf X < x1 And Y < y1 Then
    Shape1.Top = Y
    Shape1.Left = X
    ElseIf X < x1 And Y > y1 Then
    Shape1.Left = X
    End If
    Shape1.Height = Abs(Y - y1)
    Shape1.Width = Abs(X - x1)
    End If
    ElseIf Button = 2 Then
    Shape1.Width = IIf(w + X - x2 >= 0, w + X - x2, 0)
    Shape1.Height = IIf(h + Y - y2 >= 0, h + Y - y2, 0)
    ElseIf Button = 3 Then
    If going = False Then Call Picture1_MouseDown(3, 0, X, Y)
    Shape1.Top = t + Y - y3
    Shape1.Left = l + X - x3
    End If
    If Button <> 0 Then
        showpoint
        If Shape2(0).Visible = False Then
            For i = 0 To 8
                If i <> 4 Then
                Shape2(i).Visible = True
                End If
            Next
        End If
    End If
    End Sub
    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DOING = False
    going = False
    End SubPrivate Sub showpoint()
    For i = 0 To 8
        If i <> 4 Then
            If i \ 3 = 0 Then Shape2(i).Top = Shape1.Top - Shape2(i).Height / 2
            If i \ 3 = 1 Then Shape2(i).Top = Shape1.Top + Shape1.Height / 2 - Shape2(i).Height / 2
            If i \ 3 = 2 Then Shape2(i).Top = Shape1.Top + Shape1.Height - Shape2(i).Height / 2
            If i Mod 3 = 0 Then Shape2(i).Left = Shape1.Left - Shape2(i).Height / 2
            If i Mod 3 = 1 Then Shape2(i).Left = Shape1.Left + Shape1.Width / 2 - Shape2(i).Height / 2
            If i Mod 3 = 2 Then Shape2(i).Left = Shape1.Left + Shape1.Width - Shape2(i).Height / 2
         End If
    Next
    End Sub