473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

checkbox in listbox?

hi all

i was wondering if it is posible to add checkboxe in a listbox
and if so how do i do it?

thankyou

Maarten
Jul 17 '05 #1
6 25398
Set the style property to 1-Checked.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Maarten" <gu******@hotmail.com> wrote in message
news:41*********************@news.skynet.be...
: hi all
:
: i was wondering if it is posible to add checkboxe in a listbox
: and if so how do i do it?
:
: thankyou
:
: Maarten
:
:

Jul 17 '05 #2
thank you for yourre quick reply,
i did so (set the style property to checked)
and it looks nice

but do you mightbe have a litle example code how to work with te box in the
list?

Kind regards Maarten
"Maarten" <gu******@hotmail.com> wrote in message
news:41*********************@news.skynet.be...
hi all

i was wondering if it is posible to add checkboxe in a listbox
and if so how do i do it?

thankyou

Maarten

Jul 17 '05 #3
Private Sub Form_Load()

Dim cnt As Long

For cnt = 1 To 10
List1.AddItem "Item " & cnt
Next

Command1.Caption = "Get selected items"
Command2.Caption = "Clear selection"

End Sub

Private Sub Command1_Click()

Dim cnt As Long

With List1

If .SelCount > 0 Then
For cnt = 0 To .ListCount - 1
If .Selected(cnt) = True Then
Debug.Print .List(cnt)
End If
Next
End If

End With

End Sub
Private Sub Command2_Click()

Dim cnt As Long

With List1

If .SelCount > 0 Then

For cnt = 0 To .ListCount - 1
.Selected(cnt) = False
Next

End If

End With
End Sub

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Maarten" <gu******@hotmail.com> wrote in message
news:41*********************@news.skynet.be...
: thank you for yourre quick reply,
: i did so (set the style property to checked)
: and it looks nice
:
: but do you mightbe have a litle example code how to work with te box in
the
: list?
:
: Kind regards Maarten
:
:
: "Maarten" <gu******@hotmail.com> wrote in message
: news:41*********************@news.skynet.be...
: > hi all
: >
: > i was wondering if it is posible to add checkboxe in a listbox
: > and if so how do i do it?
: >
: > thankyou
: >
: > Maarten
: >
: >
:
:

Jul 17 '05 #4
Debug.Print

ive seen this command being used a couple of times.
what is this command for?

thankyou Maarten

"Randy Birch" <rg************@mvps.org> wrote in message
news:CO********************@rogers.com...
Private Sub Form_Load()

Dim cnt As Long

For cnt = 1 To 10
List1.AddItem "Item " & cnt
Next

Command1.Caption = "Get selected items"
Command2.Caption = "Clear selection"

End Sub

Private Sub Command1_Click()

Dim cnt As Long

With List1

If .SelCount > 0 Then
For cnt = 0 To .ListCount - 1
If .Selected(cnt) = True Then
Debug.Print .List(cnt)
End If
Next
End If

End With

End Sub
Private Sub Command2_Click()

Dim cnt As Long

With List1

If .SelCount > 0 Then

For cnt = 0 To .ListCount - 1
.Selected(cnt) = False
Next

End If

End With
End Sub

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Maarten" <gu******@hotmail.com> wrote in message
news:41*********************@news.skynet.be...
: thank you for yourre quick reply,
: i did so (set the style property to checked)
: and it looks nice
:
: but do you mightbe have a litle example code how to work with te box in
the
: list?
:
: Kind regards Maarten
:
:
: "Maarten" <gu******@hotmail.com> wrote in message
: news:41*********************@news.skynet.be...
: > hi all
: >
: > i was wondering if it is posible to add checkboxe in a listbox
: > and if so how do i do it?
: >
: > thankyou
: >
: > Maarten
: >
: >
:
:

Jul 17 '05 #5
On Thu, 7 Oct 2004 14:35:27 +0200, "Maarten" <gu******@hotmail.com>
you typed some letters in random order:
Debug.Print

ive seen this command being used a couple of times.
what is this command for?
Hit CRTL-g the debug window will open.
when you run the code, the lines and value's after the 'debug.print'
wil apear in this window. Very helpfull for tracking your code.

thankyou Maarten


Groetjenz,

Mickey
--
#### gewoan skrieve su ast ut seist ####
Jul 17 '05 #6
thank you all for the reply

greets Maarten

"mickey" <mickeyATgruizelgruis.nl> wrote in message
news:t6********************************@4ax.com...
On Thu, 7 Oct 2004 14:35:27 +0200, "Maarten" <gu******@hotmail.com>
you typed some letters in random order:
Debug.Print

ive seen this command being used a couple of times.
what is this command for?

Hit CRTL-g the debug window will open.
when you run the code, the lines and value's after the 'debug.print'
wil apear in this window. Very helpfull for tracking your code.

thankyou Maarten


Groetjenz,

Mickey
--
#### gewoan skrieve su ast ut seist ####

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephen | last post by:
Im very new to coding and I was wondering if anyone could please tell me how to select all the items in a listbox when a checkbox is checked, and then when the checkbox is unchecked to unselected...
3
by: Vaughn | last post by:
I have a textbox in my Win form that can be filled when a user chooses an emplcode from a combobox and when the value is returned from another form (double-clicks on a separate listbox). What...
2
by: John R. | last post by:
I want to have a listbox that shows a checkbox and a textbox. I created a user control that has a checkbox and a textbox in it and have been trying to add it to a listbox but I can't get it to...
2
by: Edmilson | last post by:
Hello All I have a Datalist where each "Item" contains a checkbox (among other things). I want the user to be able to click on one or more checkboxes, click the Send button, and have something...
6
by: segue | last post by:
Hi; I need to change the order of a listbox array from a form app where I select order up or down. What's a good way to do that? Regards; Segue
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: Priya | last post by:
I have to display a checboxlist with someitems when each item in a listbox is selected. I have a listbox with a list of categories and when i click each category from the listbox, the checkbox list...
1
by: pradeep | last post by:
Hi, I want to display Listbox containing check boxes in HTML. How can i do this ? Can you guide me.
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the...
3
by: mbedford | last post by:
I'm creating an asset/employee/everything including the kitchen sink database for my office. Currently I'm working on formEmployee. It contains a listbox which contains all the employees, and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.