Results 1 to 2 of 2

Thread: ItemCheck / ListBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Exclamation

    How can I trigger the ItemCheck Method of a
    ListBox ONLY if a box is checked (and not if a
    a box is unchecked also)?
    0101011001000010
    01101111011011100110110001101001011011100110010101110010

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    First of all, it is an Event, not a Method.
    Secondly, you can't force the ListBox to raise the event in a different manner.
    But, when the event is raised, you can check if the box is checked or not, using the Selected property.
    Try this:
    Code:
    Private Sub MyListBox_ItemCheck(Item As Integer)
        ' Is the box checked? If not, exit the event
        If Not MyListBox.Selected(Item) Then Exit Sub
        
        ' If this line is reached, then the box is checked
        ' Put more code here!
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width