Groups | Blog | Home
all groups > vb.net controls > july 2004 >

vb.net controls : Error !Object reference not set to an instance of an object. !!! Help



parthivjoshi NO[at]SPAM rediffmail.com
7/2/2004 2:34:58 AM
I am getting this error when I am trying to create a listbox of 7
textbox values on my page..In below code ( dateone to dateseven are
label controls )..I want to collect the values of these label controls
when the page executes..but I am getting above error...

Dim weekdayslist As ListBox
weekdayslist.Items.Add("dateone")
weekdayslist.Items.Add("datetwo")
weekdayslist.Items.Add("datethree")
weekdayslist.Items.Add("datefour")
weekdayslist.Items.Add("datefive")
weekdayslist.Items.Add("datesix")
weekdayslist.Items.Add("dateseven")

For i As Int32 = 0 To weekdayslist.Items.Count - 1
weekdayslist.Items(i).Selected = True
lblErr.Text = weekdayslist.SelectedItem.Value &
"<br>"
hirf-spam-me-here NO[at]SPAM gmx.at
7/2/2004 11:59:18 AM
* parthivjoshi@rediffmail.com (Parthiv Joshi) scripsit:
[quoted text, click to view]

.... 'As New ListBox()'

[quoted text, click to view]

--
Herfried K. Wagner [MVP]
Kalyan
7/2/2004 3:58:57 PM
Where is the "new" for ListBox?

[quoted text, click to view]

AddThis Social Bookmark Button