Results 1 to 2 of 2

Thread: Disable items in listbox

  1. #1

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105
    How can I enable/disable items within a drop-down list box depending on what has been selected in a second drop-down list box?

    Thanks,

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    There may or may not be a way to actually disable specific items using the APIs, but you can simulate it by setting the ItemData of the rows you want to disable to 1 (or some other non-zero value) and then put this code in the list's click event

    Code:
        If List1.ListIndex = -1 Then Exit Sub
        
        If List1.ItemData(List1.ListIndex) = 1 Then
            List1.Selected(List1.ListIndex) = False
            MsgBox "disabled"
        End If

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