Click here to Skip to main content
15,847,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have checked combo box consisting of some items.What i want is, if user selects any of them,he should not be able to select other items,,,,how can i do that...please help me..
Posted

1 solution

Capture the checklistbox_itemcheck event and put this code in there
VB
For i As Integer = 0 To _ListBox.Items.Count - 1
    If i <> e.Index Then
        _ListBox.SetItemChecked(x, False)
    End If
Next
 
Share this answer
 
Comments
DileepkumarReddy 21-Apr-12 3:10am    
Hi,
but there is no event called "checklistbox_itemcheck " for checked combo box...can you please elaborate...
Abhinav S 21-Apr-12 3:17am    
If you are using CheckListBox you should be able to see an ItemCheck event - http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.itemcheck.aspx.
DileepkumarReddy 21-Apr-12 6:24am    
Thank you Mr.Abhinav
Abhinav S 21-Apr-12 6:39am    
You are welcome.
DileepkumarReddy 21-Apr-12 7:29am    
Hi,one more complication..i have Checked Combobox..
Items are

Squared Off TO
Delivety TO
Squared Off Buy TO
Squared Off Sell TO
Delivery Buy TO
Delivery Sell TO..

Now,if he select "Squared Off TO" user should be able to select either "Delivery TO" Or "(Delivery Buy TO and Delivery Sell TO)"..
same way ..if he select "Delivery TO",he should be able to select either
"Squared Off TO" or (Squared Off Buy TO and Squared Off Sell TO)..

hw can i do this...help me out..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900