Hello everybody,
I am not only new to VB.NET but to programming as well(startted about two weeks ago). I am having a problem that I can't seem to figure out.
I have a form with a menu item automobile. The menu items listed below this one are add and delete (when you click on automobile these appear).
I have three comboboxes in the middle of the form, called ComboxAutomobileType, ComboPrice and ComboQuantity.
The three comboboxes are linked meaning that regardless of where I make a selection, the other two will also display the corresponding information to the selection I made.
What I want is to set the delete menu item 's (MnuDelete) enabled property to false if nothin has been selected.
The following is what I tried:
Private Sub MnuAutomobile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuAutomobile.Click
If (ComboAutomobileType.SelectedIndex > -1) Then
MnuDelete.Enabled = True
End If
End Sub
and then I tried the following:
Private Sub MnuAutomobile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuAutomobile.Click
If (ComboAutomobileType.SelectedItem Is Nothing) Then
MnuDelete.Enabled = False
Else
MnuDelete.Enabled = True
End If
end sub
but nothing worked. Any help would be greatly appreciated.
I am not only new to VB.NET but to programming as well(startted about two weeks ago). I am having a problem that I can't seem to figure out.
I have a form with a menu item automobile. The menu items listed below this one are add and delete (when you click on automobile these appear).
I have three comboboxes in the middle of the form, called ComboxAutomobileType, ComboPrice and ComboQuantity.
The three comboboxes are linked meaning that regardless of where I make a selection, the other two will also display the corresponding information to the selection I made.
What I want is to set the delete menu item 's (MnuDelete) enabled property to false if nothin has been selected.
The following is what I tried:
Private Sub MnuAutomobile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuAutomobile.Click
If (ComboAutomobileType.SelectedIndex > -1) Then
MnuDelete.Enabled = True
End If
End Sub
and then I tried the following:
Private Sub MnuAutomobile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuAutomobile.Click
If (ComboAutomobileType.SelectedItem Is Nothing) Then
MnuDelete.Enabled = False
Else
MnuDelete.Enabled = True
End If
end sub
but nothing worked. Any help would be greatly appreciated.