Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / February 2005

Tip: Looking for answers? Try searching our database.

Change text of a CheckListBox item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kevininstructor@state.or.us - 25 Feb 2005 19:30 GMT
I get an item text using
SomeVar = CheckLB.GetItemText(.SelectedItem)

Now I want to manipulate "SomeVar" then move the new value back into the
item it was taken from. I can't seem to find the method to change the items
text.

Thanks for any assistance,
Kevin
Tim Wilson - 25 Feb 2005 20:15 GMT
Just use the Items collection and the appropriate index.

Dim selectedIndex As Integer
Dim selectedItemText As String
selectedIndex = Me.CheckedListBox1.SelectedIndex
selectedItemText = Me.CheckedListBox1.Items.Item(selectedIndex).ToString()
selectedItemText += " modified"
Me.CheckedListBox1.Items.Item(selectedIndex) = selectedItemText

Signature

Tim Wilson
.Net Compact Framework MVP

> I get an item text using
> SomeVar = CheckLB.GetItemText(.SelectedItem)
[quoted text clipped - 5 lines]
> Thanks for any assistance,
> Kevin
Herfried K. Wagner [MVP] - 25 Feb 2005 20:29 GMT
Kevin,

"kevininstructor@state.or.us" <Kevin.S.Gallagher@state.or.us> schrieb:
>I get an item text using
> SomeVar = CheckLB.GetItemText(.SelectedItem)
[quoted text clipped - 3 lines]
> items
> text.

\\\
With Me.CheckedListBox1
   .Items(.SelectedIndex) = .GetItemText(.SelectedItem) & " (!)"
End With
///

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

kevininstructor@state.or.us - 28 Feb 2005 14:13 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.