Chapter 5 and 6 of Beg. VB.Net 2003
Can somebody please tell me what I did wrong because I followed the book and looked at the code in the Wrox website an it still does not solve my issue.
For chapters 5 and 6:
Chapter 5:
Public ReadOnly Property SelectedCustomers() As Customer
Get
'do we have a selection
If lstCustomers.SelectedIndex <> -1 Then
'return the selected customer...
Return lstCustomers.Items(lstCustomers.SelectedIndex)
End Get
End Property
Chapter 6:
'UpdateDisplay- update the display...
Public Function UpdateDisplay() As String
'What text do we want to use?
Dim strCountText As String = txtWords.Text
Dim strResultText As String
'do we want to count words?
If radCountWords.Checked = True Then
'count the words...
Dim intWords As Integer = CountWords(strCountText)
'return the text...
strResultText = intWords & "words"
Else
'count the chars...
Dim intChars As Integer = CountCharacters(strCountText)
'return the text...
strResultText = intChars & "characters"
End If
'update the display...
lblResults.Text = strResultText
End Function
Every time I run and change this code to the book it says that my If statement needs a null set value set or all the possibilites will not be considered during runtime. I appreciate if anyone can tell me what I need to do and what I did wrong. Thanks.
|