代码如下:
'Form窗口命名为MainFrom
'在Form窗口中放入一个PictureBox控件,命名为PicMain
Dim Room As Boolean
Private Sub Form_Load()
MainForm.ScaleMode = 3
PicMain.ScaleMode = 3
End Sub
Private Sub PicMain_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X <= PicMain.ScaleWidth And X >= PicMain.ScaleWidth - 10 _
   And Y <= PicMain.ScaleHeight And Y >= PicMain.ScaleHeight - 10 Then
  Room = True
End If
End Sub
Private Sub PicMain_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And Room = True Then
   PicMain.Width = Abs(X) + 10
   PicMain.Height = Abs(Y) + 10
End If
End Sub
Private Sub PicMain_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Room = False
End Sub
'还是要打上“原创”的记号
--------------------------------------------------------------------
Made by Thirdapple's Studio(http://3rdapple.51.net/)