i have 3 selections in a combobox...
can i make it to..
case1, only the first alternative can be selected, but the other 2 alternatives are locked...
case2, only second alternative can be selected and
case3, only thrid alternative can be selected...
Sounds to me like you may want to review whether a combobox is the right control to be using. Not because it is impossible to do what you are asking, but because the scenario you describe suggests that a combobox may be the wrong thing to be using.
hmm .. what i'm trying to explain at here is...
i have 7 selections in a combobox...
can i make it to..
case1, only 3 alternatives can be selected, but the other 2 alternatives are locked...
case2, only 5 alternatives can be selected and
case3, all 7 alternatives can be selected...
Brute force. Square pegs do fit into round holes. In your click event, validate the listIndex. For invalid selections, set listIndex to zero or a valid index value.
Identifying valid indicies complicates this solution especially with a dynamic or volitle list.
Another choice is to eliminate your problem...
Reset the list when the "case" or selection criteria changes. This way your list contains only valid selections. Do you really want to force your users to look at seven items when only three apply?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.