|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
accessing listbox item valueI am just learning to program and cannot figure out what is wrong with the
following line of code. I am trying to take the value of one item from a ListBox and assign it to a string variable. Please help. Thanks. strExistingTime = lstTimes.Items.Item(intCounter).ToString() If all you have for each item is text then this will work, how are you
loading your listbox? Show quoteHide quote "Candace" <Cand***@discussions.microsoft.com> wrote in message news:372436B9-C1AE-4CC1-A746-E070D5DA08C5@microsoft.com... >I am just learning to program and cannot figure out what is wrong with the > following line of code. I am trying to take the value of one item from a > ListBox and assign it to a string variable. Please help. Thanks. > > strExistingTime = lstTimes.Items.Item(intCounter).ToString() > Here is the portion of the code where I add info to the listbox:
' display new appointment in ListBoxes lstAppointments.Items.Add(txtAppointment.Text) lstTimes.Items.Add(dtpTime.Value.ToShortTimeString) Show quoteHide quote "kevininstruc***@state.or.us" wrote: > If all you have for each item is text then this will work, how are you > loading your listbox? > > > "Candace" <Cand***@discussions.microsoft.com> wrote in message > news:372436B9-C1AE-4CC1-A746-E070D5DA08C5@microsoft.com... > >I am just learning to program and cannot figure out what is wrong with the > > following line of code. I am trying to take the value of one item from a > > ListBox and assign it to a string variable. Please help. Thanks. > > > > strExistingTime = lstTimes.Items.Item(intCounter).ToString() > > > > >
To VB or not to VB?
To VB or not to VB? Excel automation??? VS2005 - Debug and Locked Files Debugging in VS2005 - why is some code shaded grey? SqlConnection component in VB.2005 For each ..... next Question Dir(strPath, +R +A +S +H) keeps returning hidden folders Setup and Deployment and Microsoft Jet OLE DB Provider Address Matching System |
|||||||||||||||||||||||