Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
MsgBox("รหัสชื่อ :" & Text1.Text & vbCrLf & "รหัสนามสกุล :" & Text2.Text)
End Sub
'ส่วนที่สอง ประมวลผล
Private Sub Text1_Change()
If Text1.Text <> "ก,ข,ค,ฆ,ง" Then
Command1.Enabled = "1"
End If
If Text1.Text <> "จ,ฉ,ช,ซ,ฌ" Then
Command1.Enabled = "2"
End If
If Text1.Text <> "ญ,ฎ,ฏ,ฐ,ฑ" Then
Command1.Enabled = "3"
End If
If Text1.Text <> "ฒ, ณ, ด, ต ,ถ" Then
Command1.Enabled = "4"
End If
If Text1.Text <> "ท,ธ ,น ,บ, ป" Then
Command1.Enabled = "5"
End If
If Text1.Text <> "ผ, ฝ ,พ ,ฟ ,ภ " Then
Command1.Enabled = "6"
End If
If Text1.Text <> "ม, ย ,ร ,ล, ว" Then
Command1.Enabled = "7"
End If
If Text1.Text <> "ศ, ษ ,ส ,ห , ว" Then
Command1.Enabled = "8"
End If
End Sub
Private Sub Text2_Change()
If Text2.Text <> "ก,ข,ค,ฆ,ง" Then
Command1.Enabled = "1"
End If
If Text2.Text <> "จ,ฉ,ช,ซ,ฌ" Then
Command1.Enabled = "2"
End If
If Text2.Text <> "ญ,ฎ,ฏ,ฐ,ฑ" Then
Command1.Enabled = "3"
End If
If Text2.Text <> "ฒ, ณ, ด, ต ,ถ" Then
Command1.Enabled = "4"
End If
If Text2.Text <> "ท,ธ ,น ,บ, ป" Then
Command1.Enabled = "5"
End If
If Text2.Text <> "ผ, ฝ ,พ ,ฟ ,ภ " Then
Command1.Enabled = "6"
End If
If Text2.Text <> "ม, ย ,ร ,ล, ว" Then
Command1.Enabled = "7"
End If
If Text2.Text <> "ศ, ษ ,ส ,ห , ว" Then
Command1.Enabled = "8"
End If
End Sub
Private Sub From_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
End Class