December2000
asked on
Case Statements in VB.Net
Hi Experts!
I am missing something.... The results should be "returned" txtWords.... Need an extra pair of expert eyes.... What am I missing? I am a newbie to .net :(
I am missing something.... The results should be "returned" txtWords.... Need an extra pair of expert eyes.... What am I missing? I am a newbie to .net :(
Public Class Form1
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtNumber.Clear()
txtWords.Clear()
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim Sure As System.Windows.Forms.DialogResult
Sure = CType(MsgBox("Are You Sure?", MsgBoxStyle.YesNo), Windows.Forms.DialogResult)
If Sure = MsgBoxResult.Yes Then
Me.Close()
Else
End If
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim strWords As String
Dim intNumber As Integer
intNumber = CInt(txtNumber.Text)
Select Case intNumber
Case 1
strWords = ("One" & ControlChars.CrLf)
Case 2
strWords = ("Two" & ControlChars.CrLf)
Case 3
strWords = ("Three" & ControlChars.CrLf)
Case 4
strWords = ("Four" & ControlChars.CrLf)
Case 5
strWords = ("Five" & ControlChars.CrLf)
Case 6
strWords = ("Six" & ControlChars.CrLf)
Case 7
strWords = ("Seven" & ControlChars.CrLf)
Case 8
strWords = ("Eight" & ControlChars.CrLf)
Case 9
strWords = ("Nine" & ControlChars.CrLf)
Case 0
strWords = ("Zero" & ControlChars.CrLf)
End Select
End Sub
Private Sub txtNumber_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNumber.TextChanged
End Sub
Private Sub txtWords_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWords.TextChanged
End Sub
End Class
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you @ xuserx2000
Yes, how to display the results in txtWords.... It a application that converts 0-9 into words however there is a loop that continues to display the numbers as words as long as you continue enter the numbers.
Yes, how to display the results in txtWords.... It a application that converts 0-9 into words however there is a loop that continues to display the numbers as words as long as you continue enter the numbers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
Or are you asking how to display the result of "strWords" ?