VB Code:
Dim shpX As Integer
Dim shpY As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
shpX = X
shpY = Y
shpSelect.Top = shpY
shpSelect.Left = shpX
shpSelect.Width = 100
shpSelect.Height = 100
shpSelect.Visible = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If shpX > 0 And shpY > 0 Then
If X - shpX > 0 Then
shpSelect.Width = X - shpX
Else
shpSelect.Width = shpX - X
shpSelect.Left = shpX - (shpX - X)
End If
If Y - shpY > 0 Then
shpSelect.Height = Y - shpY
Else
shpSelect.Height = shpY - Y
shpSelect.Top = shpY - (shpY - Y)
End If
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
shpX = 0
shpY = 0
shpSelect.Visible = False
End Sub