VB5 (32) programmatically control checkboxes in listbox 
Author Message
 VB5 (32) programmatically control checkboxes in listbox

I have a list box showing checkboxes next to the list items (style set
to 1). No problem. I can process the List_ItemCheck event no problem.
However, how (if at all) can I programmatically "tick" the check
boxes? That is, show the user their previous choices when reloading a
particular list of options. I can't seem to find a property related to
the ItemCheck event. Any help gratefully recieved!

Tony

--
Dr Tony Gillie
IT Consultancy, Programming, and Desktop Publishing Services

PGP Key ID 54B4E689, Fingerprint E61CA9B811188727 4AFC4B12B7E00B4B



Sat, 20 May 2000 03:00:00 GMT  
 VB5 (32) programmatically control checkboxes in listbox

Sorry if this posted twice....
___________________________________________
Tony-
        It's the selected property.
                        Joe
________snip_______________________________-
Option Explicit

Private Sub Command1_Click()
    List1.Selected(List1.ListIndex) = _
        Not List1.Selected(List1.ListIndex)
End Sub

Private Sub Form_Load()
    Dim i%
    For i = 1 To 5
        List1.AddItem CStr(i)
    Next
End Sub
_____________snip__________________________

--
***********************************************************

Microsoft Developer MVP- Visual Basic
"Freedom is never voluntarily given by the
 oppressor; it must be demanded by the
oppressed." (Martin Luther King, Jr.)
**********************************************************
PS- Please reply to the newsgroup- except in the
case of flames, insults, etc. (Don't bother.)



Quote:
> I have a list box showing checkboxes next to the list items (style set
> to 1). No problem. I can process the List_ItemCheck event no problem.
> However, how (if at all) can I programmatically "tick" the check
> boxes? That is, show the user their previous choices when reloading a
> particular list of options. I can't seem to find a property related to
> the ItemCheck event. Any help gratefully recieved!

> Tony

> --
> Dr Tony Gillie
> IT Consultancy, Programming, and Desktop Publishing Services

> PGP Key ID 54B4E689, Fingerprint E61CA9B811188727 4AFC4B12B7E00B4B



Sat, 20 May 2000 03:00:00 GMT  
 VB5 (32) programmatically control checkboxes in listbox

Tony,

Quote:
>I have a list box showing checkboxes next to the list items (style set
>to 1). No problem. I can process the List_ItemCheck event no problem.
>However, how (if at all) can I programmatically "tick" the check
>boxes? That is, show the user their previous choices when reloading a
>particular list of options. I can't seem to find a property related to
>the ItemCheck event. Any help gratefully recieved!

Set the check box value to the value you previously saved. If the checkbox
was checked, set the value to 1 otherwise set it to zero.

David



Sat, 20 May 2000 03:00:00 GMT  
 VB5 (32) programmatically control checkboxes in listbox

I think what you are looking for is the Selected() Property.

For example, if I have a listbox(Style=1) called lstList, and it has 3
items in it, and I want to select the 2 item in the list, I would do
something like:

lstList.Selected(1) = True

This is zero-based, so Selected(0) = Item 1, Selected(1) = Item 2, etc.

Hope that helps.

Mark

--
Mark A. Essex
Micro Solutions
http:\\microsolutions.home.mindspring.com



Quote:
> I have a list box showing checkboxes next to the list items (style set
> to 1). No problem. I can process the List_ItemCheck event no problem.
> However, how (if at all) can I programmatically "tick" the check
> boxes? That is, show the user their previous choices when reloading a
> particular list of options. I can't seem to find a property related to
> the ItemCheck event. Any help gratefully recieved!

> Tony

> --
> Dr Tony Gillie
> IT Consultancy, Programming, and Desktop Publishing Services

> PGP Key ID 54B4E689, Fingerprint E61CA9B811188727 4AFC4B12B7E00B4B



Sat, 20 May 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB5 (32) programmatically control checkboxes in listbox

2. Listbox Control VB5 - Style = CheckBox

3. 3rd Party ListBox / ComboBox controls (32 bit) recommendations?

4. 3rd Party ListBox / ComboBox controls (32 bit) recommendations?

5. To control checkboxes in ListBox control

6. TIME TO WIN 32-Bit DLL for VB 4.0 32-Bit or Higher (VB5)

7. Controls created in VB5 used in VB4-32?

8. Controls changed from VB4/32 to VB5

9. I seek ListBox+CheckBox as one control.

10. Checkbox in a listbox control.

11. Checkbox and test in listbox-control

12. VB5 and/or VB6 Control - Advanced Listbox Control Needed -

 

 
Powered by phpBB® Forum Software