【正确答案】【操作步骤】 步骤1:打开本题工程文件。
步骤2:打开代码编辑窗口,去掉程序中的注释符“'”,将问号改为正确的内容。
参考答案(字体加粗部分是需考生填入的内容)
Dim left0 As Integer
ConSt blue_color=&HFF0000,red_color=&HFF&
Private Sub Command1_Click()
Timer1.Enabled=
True '单击"开始"按钮,Timer生效
End Sub
Private Sub Command2_Click()
Timer1.Enabled=False '单击"结束"按钮,Timer失效
End Sub
Private Sub Form_Load()
left0=Shape1.Left '加载窗体时,初始化圆心到窗体的距离
End Sub
Private Sub Timer1_Timer()
If Shape1.FiliColor=blue_color Then
If Shape1.Left>0 Then
Shape1.Height =Shape1.Height+100 '圆的高扩大100
Shape1.Width=Shape1.Width+100
Shape1.Left=Shape1.Left-50 '圆心到图片框左边上边的距离
Shape1.Top=Shape1.Top-50
Else
Shape1.FillColor=
red_color '当充满图片框时则变色
End If
End If
If Shape1.FiliColor=red_color Then
If Shape1.Left<left0 Then
Shape1.Height=Shape1.Height-100
Shape1.Width=Shape1.Width-100
Shape1.Left=Shape1.Left+50
'设置Shape1的左边位置
Shape1.Top=Shape1.Top+50
'设置Shape1的上界位置
Else
Shape1.FillColor=
blue_color '当缩小到原始大小时则变色
End If
End If
End Sub
步骤3:调试并运行程序,关闭程序后按题目要求存盘。