Hi guys
I have a problem with loops, I have five list of items on the combobox. When I click the item on combobox like "Item 1", the button enable set to true which it easy to write so when I point down on the list on combobox and pick "Item 2" to set the button enable to true. If I return to "Item 1" and the button enable set to true once again but if I select "Item 1" again that have already been selected, the button enable should set to false. How can I block the loops of getting pass in each of those lines??
Here it the code:
Hope you guys will be able to advance me with this.
Thanks,
Mark
I have a problem with loops, I have five list of items on the combobox. When I click the item on combobox like "Item 1", the button enable set to true which it easy to write so when I point down on the list on combobox and pick "Item 2" to set the button enable to true. If I return to "Item 1" and the button enable set to true once again but if I select "Item 1" again that have already been selected, the button enable should set to false. How can I block the loops of getting pass in each of those lines??
Here it the code:
VB.NET:
If Combobox1.SelectedItem = "Item 2" Then
If Combobox1.SelectedItem = "Item 1" Then
Button1.Enabled = True
Else
If Combobox1.SelectedItem = "Item 1" Then
If Combobox1.SelectedItem = "Item 1" Then
Button1.Enabled = False
End If
End If
Hope you guys will be able to advance me with this.
Thanks,
Mark