又来了,一个关于shape的问题理解不到~
Private Sub HScroll1_Change()
Shape2.Left = HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Shape2.Top = VScroll1.Value
End Sub
Private Sub Form_Load()
VScroll1.Min = Shape1.Top
VScroll1.Max = Shape1.Top + Shape1.Height - Shape2.Height
HScroll1.Min = Shape1.Left
HScroll1.Max = Shape1.Left + Shape1.Width - Shape2.Width
End Sub
Shape2.Left = HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Shape2.Top = VScroll1.Value
End Sub
Private Sub Form_Load()
VScroll1.Min = Shape1.Top
VScroll1.Max = Shape1.Top + Shape1.Height - Shape2.Height
HScroll1.Min = Shape1.Left
HScroll1.Max = Shape1.Left + Shape1.Width - Shape2.Width
End Sub
我不明白为什么限制圆圈走出矩形范围的代码是~
VScroll1.Max = Shape1.Top + Shape1.Height - Shape2.Height 和 HScroll1.Max = Shape1.Left + Shape1.Width - Shape2.Width
谁可以解释一下。