troubleshooting Question

Case Statements in VB.Net

Avatar of December2000
December2000 asked on
.NET Programming
6 Comments3 Solutions311 ViewsLast Modified:
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 :(

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
ASKER CERTIFIED SOLUTION
Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros