• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Checks in a checkbox

I just put a listbox on my form and changed it's style to checkbox.  I want the user to be able to add items to that checkbox (I know how to do that part) but when the items are added I want them to be checked automatically.  How do I check/uncheck them through code.  I also want to know how to find out weather or not they are checked later.

1 Solution
to set.

List1.AddItem "select this"
List1.Selected(List1.ListCount - 1) = True

to check if selected.

List1.Selected(1)'listindex to check
returns true or false


If a ListBox control’s Style property is set to 1 (check boxes), the Selected property returns True only for those items whose check boxes are selected. The Selected property will not return True for those items which are only highlighted.

RaAuthor Commented:
Ah ha... I knew it was something simple.  I was looking for a value or checked property.  I didn't think about the check being releated to the selected property.  Thanks guys.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now