Étape 10 : Le Code complet
Voici le code complété pour le projet :Public Class Form1
Dim txtLen As Integer
Private void hidden_TextChanged (System.Object sender, System.EventArgs e) poignées cachées. TextChanged
txtLen = Len (cachée. Texte)
pétition. Texte = Microsoft.VisualBasic.Left ("s’il vous plaît répondre à la question suivante:", txtLen)
Si Microsoft.VisualBasic.Right (cachée. Texte, 1) = "." Puis
sournois. Texte = Microsoft.VisualBasic.Left (cachée. Texte, Len (cachée. Texte) - 1)
End If
Si pétition. Text = "Veuillez répondre à la question suivante:" alors
question. Enabled = True
End If
End Sub
Question de poignées private void question_TextChanged (System.Object sender, System.EventArgs e). TextChanged
Si Microsoft.VisualBasic.Right (question. Texte, 1) = "?" Puis
début. Enabled = True
End If
End Sub
Private void start_Click (System.Object sender, System.EventArgs e) poignées commencent. Cliquez sur
Dim test As Boolean
Si InStr (cachée. Texte, ".") Puis
test = True
End If
Si test = False Then
sournois. Text = « Je ne peux pas répondre à cette question. »
End If
début. Enabled = False
remise à zéro. Enabled = True
réponse. Texte = sournois. Texte
question. ReadOnly = True
pétition. ReadOnly = True
End Sub
Private void reset_Click (System.Object sender, System.EventArgs e) poignées réinitialiser. Cliquez sur
remise à zéro. Enabled = False
sournois. Text = « Je ne peux pas répondre à cette question. »
pétition. Text = « Entrez votre requête, puis appuyez sur Tab. »
caché. Texte = Nothing
question. Texte = Nothing
question. Enabled = False
pétition. ReadOnly = False
question. ReadOnly = False
réponse. Texte = Nothing
End Sub
End Class