Chr3.Text = "E"
End If
If str(18) = "e" Then
Chr2.Text = "E"
End If
If str(19) = "e" Then
Chr1.Text = "E"
End If
End If
If InStr(Word_in.Text, "e", CompareMethod.Text) = 0 Then
If f_chr1.Text = "" Then
f_chr1.Text = "E"
ElseIf f_chr2.Text = "" Then
f_chr2.Text = "E"
ElseIf f_chr3.Text = "" Then
f_chr3.Text = "E"
ElseIf f_chr4.Text = "" Then
f_chr4.Text = "E"
ElseIf f_chr5.Text = "" Then
f_chr5.Text = "E"
ElseIf f_chr6.Text = "" Then
f_chr6.Text = "E"
ElseIf f_chr7.Text = "" Then
f_chr7.Text = "E"
ElseIf f_chr8.Text = "" Then
f_chr8.Text = "E"
ElseIf f_chr9.Text = "" Then
f_chr9.Text = "E"
ElseIf f_chr10.Text = "" Then
f_chr10.Text = "E"
ElseIf f_chr11.Text = "" Then
f_chr11.Text = "E"
End If
End If
End Sub
Дважды щёлкаем по кнопке Button с именем Name для 6-й буквы F. Появившийся шаблон метода после записи нашего кода принимает следующий вид.
Листинг 19.7. Метод-обработчик щелчка кнопки.
Private Sub F_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles F.Click
F.Enabled = False
nums = Len(Word_in.Text)
Try
str(0) = Mid(Word_in.Text, nums, 1)
str(1) = Mid(Word_in.Text, nums – 1, 1)
str(2) = Mid(Word_in.Text, nums – 2, 1)
str(3) = Mid(Word_in.Text, nums – 3, 1)
str(4) = Mid(Word_in.Text, nums – 4, 1)
str(5) = Mid(Word_in.Text, nums – 5, 1)
str(6) = Mid(Word_in.Text, nums – 6, 1)
str(7) = Mid(Word_in.Text, nums – 7, 1)