Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes in Combos?

Status
Not open for further replies.

spence27

Technical User
Feb 2, 2002
28
GB
Two questions

1) Is it possible via VBA to add a check box to a listbox for example list all the days of the week on each row and have acheckbox on each lin e so someone could choose their favorite days.

2)If possible, how is done.

Any help on this would be greatfuly recieved.

Thanks#Spence
 



Hi,

Use a Listbox instead, using the MultiSelect property.

Skip,

[glasses] [red][/red]
[tongue]
 
It would if i havge to go down that route. I was just trying to make in a bit more intuative rather than have people holding the CTRL key as well a checkbox makes it very streight forward as to what is selected and what isn't.

I have seen checkboxes in listboxes/combos in the past but i can't remember if it was vba or VB

If anyone can shine some light on this?
 
If you're happy to go down the multiselect route (as has been mentioned several times above) but still want really the checkboxes (though with multiselect it looks a bit strange) you can change the .ListStyle property of the listbox to 1 - frmListStyleOption. With multiselect enabled this displays checkboxes next to the list entries.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Or you could go completely different and use a ListView control from the controls toolbox, they certainly do allow the use of checkboxes...

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks HarleyQuinn I knew their was some way to do it.

I'll definatly use one of you ideas i have just tested the frmListStyleOption suggestion and it does the job but i'l;l give the other a go especially if it means i can place the check box at the other end of the line.

Again thanks all for the tips
 
Hi spence,

Glad to have helped in some way, don't want to put a downer on the ListView idea but unfortunately I'm not aware of a way to switch the side that the checkbox appears on. There may be a way that I'm not aware of though?

Cheers

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top