题库 题库

【简答题】

'提供给考生的程序
Dim lenth As Integer, q As Integer
Const PI = 3.14159
Private Sub Form_Load()
    lenth = Line1.Y2 - Line1.Y1
    q = 90
End Sub
Private Sub Timer1_Timer()
    q = q - 6
    Line1.Y1 = Line1.Y2 - lenth * Sin(q * PI / 180)
    Line1.X1 = Line1.X2 + lenth * Cos(q * PI / 180)
End Sub

参考答案

'考生要编写的程序
Private Sub Command1_Click()
    Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
    Timer1.Enabled = False
End Sub

相关试题