窗体上有一个名称为Shape1并显示为圆的形状控件(其Width和Height属性值相等),一个名称为Timer1的计时器,并有下面程序代码: Dim r As Single, flag As Integer Private Sub Form_Load() r = Shape1.Width Timer1.Enabled = True Timer1.Interval = 500 End Sub Private Sub Timer1_Timer() If flag = 0 Then Shape1.Width = Shape1.Width - 10 If Shape1.Width <= 100 Then flag = 1 End If Else Shape1.Width = Shape1.Width + 10 If Shape1.Width >= r Then flag = 0 End If End If End Sub 运行程序后产生的结果是