'矩形和圆分别是shape1 和shape2
Private Sub Form_Load()
HScroll1.Min = 1
HScroll1.Max = Shape1.Width - Shape2.Width
VScroll1.Min = 1
VScroll1.Max = Shape1.Height - Shape2.Height
End Sub
Private Sub HScroll1_Change()
Shape2.Left = HScroll1.Value + Shape1.Left
End Sub
Private Sub VScroll1_Change()
Shape2.Top = VScroll1.Value + Shape1.Top
End Su