【简答题】
''给考生的程序
'Private Sub C1_Click()
'' If ? = "123456" Then
' Text1.Text = "口令正确"
'' Text1.? = ""
' Else
' Text2.Text = Text2.Text - 1
'' If Text2.Text > ? Then
' MsgBox "第" & (3 - Text2.Text) & "次口令错误,请重新输入"
' Else
' MsgBox "3次输入错误,请退出"
'' Text1.Enabled = ?
' End If
' End If
'End Sub
参考答案
'正确程序
Private Sub C1_Click()
If Text1.Text = "123456" Then
Text1.Text = "口令正确"
Text1.PasswordChar = ""
Else
Text2.Text = Text2.Text - 1
If Text2.Text > 0 Then
MsgBox "第" & (3 - Text2.Text) & "次口令错误,请重新输入"
Else
MsgBox "3次输入错误,请退出"
Text1.Enabled = False
End If
End If
End Sub
'答案:
'Text1.text 或 Me.text1.text 或 Form1.text1.text 或 C1.Parent.Text1.text
'PasswordChar
'0
'False 或 0