Private Sub Command1_Click()
Dim a As String, b As String, c As String
Dim dv As Integer, chuc As Integer, tram As Integer
tram = Text1.Text \ 100
chuc = (Text1.Text Mod 100) \ 10
dv = (Text1.Text Mod 100) Mod 10
Select Case tram
Case 0
a = " "
Case 1
a = " Mét tr¨m "
Case 2
a = " Hai tr¨m "
Case 3
a = " Ba tr¨m "
Case 4
a = " Bèn tr¨m "
Case 5
a = " N¨m tr¨m "
Case 6
a = " S¸u tr¨m "
Case 7
a = " B¶y tr¨m "
Case 8
a = " T¸m tr¨m "
Case 9
a = " ChÝn tr¨m "
End Select
Select Case chuc
Case 0
If tram = 0 Then
b = ""
ElseIf tram <> 0 And dv = 0 Then
b = ""
Else
b = "linh "
End If
Case 1
b = "mêi "
Case 2
b = "hai m¬i "
Case 3
b = "ba m¬i "
Case 4
b = "bèn m¬i "
Case 5
b = "n¨m m¬i "
Case 6
b = "s¸u m¬i "
Case 7
b = "b¶y m¬i "
Case 8
b = "t¸m m¬i "
Case 9
b = "chÝn m¬i "
End Select
Select Case dv
Case 0
c = ""
Case 1
If chuc = 0 Or chuc = 1 Then
c = "mét"
Else
c = "mèt"
End If
Case 2
c = "hai"
Case 3
c = "ba"
Case 4
c = "bèn"
Case 5
c = "n¨m"
Case 6
c = "s¸u"
Case 7
c = "b¶y"
Case 8
c = "t¸m"
Case 9
c = "chÝn"
End Select
Label2.Caption = a & b & c
End Sub
Private Sub Command2_Click()
Text1.Text = " "
Label2.Caption = " "
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
Không có nhận xét nào:
Đăng nhận xét