发布网友 发布时间:2022-04-20 09:16
共1个回答
热心网友 时间:2023-09-23 02:57
由于你没有说明每个按键的作用,
我写的是只要按“开始”按钮后“第n句”和“题目”按钮才起作用,有提醒功能。
第n句按钮随第几句变化。
按题目按钮全诗显示,当然也可改为只显示题目。
逐行手敲,亲测可用,有问题可以问我。
Dim timera As Integer
Dim timerb As Integer ' 定单击事件变量
Private Sub Command1_Click()
timera = 1
End Sub
Private Sub Command2_Click()
timerb = timerb + 1
If timera = 1 Then
If timerb = 1 Then
Label1.Caption = "弹冠振衣抚长剑,"
End If
If timerb = 2 Then
Command2.Caption = "第二句"
Label1.Caption = "扬鞭策马啸西风。"
End If
If timerb = 3 Then
Command2.Caption = "第三句"
Label1.Caption = "牵马独走天涯,品冷月无边。"
End If
If timerb = 4 Then
Command2.Caption = "第四句"
Label1.Caption = "枯灯黄卷里,寻剑在谁手。"
End If
If timerb > 4 Then
Command2.Caption = "全诗结束"
Label1.Caption = " 无题" + vbCrLf + vbCrLf + "弹冠振衣抚长剑," + vbCrLf + "扬鞭策马啸西风。" + vbCrLf + "牵马独走天涯,品冷月无边。" + vbCrLf + "枯灯黄卷里,寻剑在谁手。"
End If
End If
If timera <> 1 Then
Label1.Caption = "提醒:请先单击开始按钮!!!"
End If
End Sub
Private Sub Command3_Click()
If timera = 1 Then
Label1.Caption = " 无题" + vbCrLf + vbCrLf + "弹冠振衣抚长剑," + vbCrLf + "扬鞭策马啸西风。" + vbCrLf + "牵马独走天涯,品冷月无边。" + vbCrLf + "枯灯黄卷里,寻剑在谁手。"
End If
If timera <> 1 Then
Label1.Caption = "提醒:请先单击开始按钮!!!"
End If
End Sub
追问.