Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,417 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,355 people online right now. Registration is fast and FREE... Join Now!




Add checkboxes to listbox?

 
Reply to this topicStart new topic

Add checkboxes to listbox?

Damage
14 Oct, 2008 - 07:52 PM
Post #1

D.I.C Addict
Group Icon

Joined: 5 Jun, 2008
Posts: 738



Thanked: 7 times
Dream Kudos: 75
My Contributions
How do you add a check box to a list box? I keep getting hits for VB. Everything mentions listbox.style(i think). Why is there no property that says "checkbox"??
User is offlineProfile CardPM
+Quote Post

jacobjordan
RE: Add Checkboxes To Listbox?
14 Oct, 2008 - 07:54 PM
Post #2

class Me : Perfection
Group Icon

Joined: 11 Jun, 2008
Posts: 1,163



Thanked: 32 times
Dream Kudos: 1625
My Contributions
Haven't you ever heard of a control called CheckedListBox? Look through your toolbox, and you will find it.
User is offlineProfile CardPM
+Quote Post

Damage
RE: Add Checkboxes To Listbox?
14 Oct, 2008 - 08:05 PM
Post #3

D.I.C Addict
Group Icon

Joined: 5 Jun, 2008
Posts: 738



Thanked: 7 times
Dream Kudos: 75
My Contributions
blink.gif
could somebody just shoot me now

I've been so busy trying to find out how to add check boxes to a list box that I completely forgot about that. Explains why i couldn't find an answer.

thanks.

could a mod delete this so i don't have to feel shame every time i come here tongue.gif
User is offlineProfile CardPM
+Quote Post

jacobjordan
RE: Add Checkboxes To Listbox?
15 Oct, 2008 - 04:06 PM
Post #4

class Me : Perfection
Group Icon

Joined: 11 Jun, 2008
Posts: 1,163



Thanked: 32 times
Dream Kudos: 1625
My Contributions
QUOTE(Damage)

could somebody just shoot me now
bam

Thing is, the checkedlistbox isn't the easiest control to work with. I recently tried to use one for an application, and i could find no way to check or uncheck a specified item.
User is offlineProfile CardPM
+Quote Post

Damage
RE: Add Checkboxes To Listbox?
15 Oct, 2008 - 05:37 PM
Post #5

D.I.C Addict
Group Icon

Joined: 5 Jun, 2008
Posts: 738



Thanked: 7 times
Dream Kudos: 75
My Contributions
heres an example that i found


CODE

With lstboxImageLinks
            If .Items.Count > 0 Then
                For i As Integer = 0 To .Items.Count - 1
                    If Trim(.Items(i).ToString) = Trim(searchFile) Then
                        .SetItemChecked(i, True)
                    End If
                Next
            End If
        End With

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:58PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month