Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Checks in a checkbox

Posted on 1999-07-15
3
Medium Priority
?
162 Views
Last Modified: 2010-04-30
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.

Thanks.
0
Comment
Question by:Ra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:jbil
ID: 1525124
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

0
 
LVL 1

Accepted Solution

by:
jcastr earned 80 total points
ID: 1525125

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.

0
 

Author Comment

by:Ra
ID: 1525126
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.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

662 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question