newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
Go Back  Xtreme Visual Basic Talk > > > newbie qns: how to change listbox text/value?


Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2008, 03:32 AM
s01655468 s01655468 is offline
Freshman
 
Join Date: Mar 2003
Posts: 35
Default newbie qns: how to change listbox text/value?


i have a listbox populated with 10 items, i want to reassign listbox item number 2 with a different value/tree.

For example i want to change listbox item number 2, current "Sun" to "Moon"
My code:

iDisturb = 1

listbox1.Items.Item(iDisturb) ="Moon"

but i got error: property 'Items' is ReadOnly.
Reply With Quote
  #2  
Old 01-14-2008, 06:16 AM
davie's Avatar
davie davie is offline
Senior Contributor
 
Join Date: Jun 2002
Location: Mayo, Eire
Posts: 967
Default

you can always try this

Code:
Me.ListBox.Items.Remove(iDisturb) me.ListBox.Items.Insert(iDisturb,"Moon")
__________________
Davie
If at first you don't succeed; don't bother trying again, just go to the pub!
Why is a person that handles your money called a 'Broker'?
If quizzes are quizzical, what are tests? | Tiocfaidh ar La
Reply With Quote
  #3  
Old 01-14-2008, 09:09 AM
s01655468 s01655468 is offline
Freshman
 
Join Date: Mar 2003
Posts: 35
Default

Hi thank for your reply.

ya your solution is workable and i think it's not good to alway remove and add whenever one want to modify.

btw, i found the solution, and for those interested:

listbox1.Items.Item(iDisturb).value ="Moon"
listbox1.Items.Item(iDisturb).text="Moon"

Thank anyway!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value? newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
 
newbie qns: how to change listbox text/value?
newbie qns: how to change listbox text/value?
 
-->