Click to See Complete Forum and Search --> : List box


jalldridge
July 9th, 2001, 09:51 AM
I have a list box in my app with the style set as checkbox.

Q - how do I get some of my checkboxs to be already ticked when my form is shown to the user? I need this to represent default options.

Thanks

Jas

John G Duffy
July 9th, 2001, 10:30 AM
option Explicit

private Sub Form_Load()
Dim X
for X = 0 to 10
List1.AddItem X
next X
List1.Selected(1) = true ' set item one as checked
End Sub




John G

jalldridge
July 9th, 2001, 11:05 AM
Thanks John. Obvious when you see the code :-)

John G Duffy
July 9th, 2001, 03:59 PM
The ListBOx control does not follow the normal rules, hence the confusion. I, as well as many others, find it confusing.

John G