Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2004, 10:54 AM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap. 6 and 5 If property and function

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.









Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 1: page33 ed123 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 January 4th, 2008 01:14 PM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
help in chap 15 manal_sag BOOK: Beginning ASP 3.0 2 May 25th, 2005 02:59 AM
setting the ReadOnly property with a function creative_eye General .NET 3 May 10th, 2004 03:27 PM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.