paulthepaddy
Well-known member
hi guys this sit eh code im using
Dim Car_Select As New List(Of ExecutableItem)
this is declaired in the form class, not in any event or sub
this is in the form load event, which works the combobox does get the car 1 added
this is in a button click event But it wont add car 2 to the combobox
it does pass the if statement as the clear_Car_Details does get called
Dim Car_Select As New List(Of ExecutableItem)
this is declaired in the form class, not in any event or sub
this is in the form load event, which works the combobox does get the car 1 added
VB.NET:
Car_Select.Add(New ExecutableItem With {.Text = "Car 1", .Method = AddressOf View_car1})
With ComboBox1
.DisplayMember = "Text"
.ValueMember = "method"
.DataSource = Car_Select
End With
this is in a button click event But it wont add car 2 to the combobox
VB.NET:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_Finish.Click
If car1.finished = False Then
car1.Make = ComboBox_Car_Maker.Text
car1.Model = ComboBox_Car_Model.Text
car1.Colour = ComboBox_Car_Colour.Text
car1.Reg = StrConv(TXT_Car_reg.Text, VbStrConv.Uppercase)
car1.Subtotal = Car_Price_Subtotal.Value
If CheckBox_Discount.Checked = True Then
car1.Discount = SSR_add_Minus.Value
car1.additional = 0
Else
car1.Discount = 0
car1.additional = SSR_add_Minus.Value
End If
car1.Total = Car_Price_Total.Value
car1.finished = True
Car_Select.Add(New ExecutableItem With {.Text = "Car 2", .Method = AddressOf View_Car2})
With ComboBox1
.DisplayMember = "Text"
.ValueMember = "method"
.DataSource = Car_Select
End With
Call clear_car_Details()
Exit Sub