S
sparkle
Hi Everybody,
I'm filling a combobox from a class, which works fine on it's own.
But when I insert code to fill in other controls something in the
combobox fill is causing the SelectedIndexChanged event to happen
when the form (hence combobox) loads, not when I select something
from the combobox.
Do I have something in the wrong order? I've read that that sometimes
makes a difference...
Thanks for any suggestions,
Here's my code:
Dim ClassVehicleID As New ParkingPermits.BizLogic.Vehicle
VehicleInfo = ClassVehicleID.GetAllVehicles
With cboSearchCountyVehicle
' .DataSource = VehicleInfo
.DisplayMember = "VehicleID"
.ValueMember = "VehicleID"
.SelectedIndex = -1
End With
Private Sub cboSearchCountyVehicle_SelectedIndexChanged(ByVal
sender As Object, ByVal e As System.EventArgs) Handles
cboSearchCountyVehicle.SelectedIndexChanged
LoadPermitInfofromCountyVehicle()
End Sub
I'm filling a combobox from a class, which works fine on it's own.
But when I insert code to fill in other controls something in the
combobox fill is causing the SelectedIndexChanged event to happen
when the form (hence combobox) loads, not when I select something
from the combobox.
Do I have something in the wrong order? I've read that that sometimes
makes a difference...
Thanks for any suggestions,
Here's my code:
Dim ClassVehicleID As New ParkingPermits.BizLogic.Vehicle
VehicleInfo = ClassVehicleID.GetAllVehicles
With cboSearchCountyVehicle
' .DataSource = VehicleInfo
.DisplayMember = "VehicleID"
.ValueMember = "VehicleID"
.SelectedIndex = -1
End With
Private Sub cboSearchCountyVehicle_SelectedIndexChanged(ByVal
sender As Object, ByVal e As System.EventArgs) Handles
cboSearchCountyVehicle.SelectedIndexChanged
LoadPermitInfofromCountyVehicle()
End Sub