paulthepaddy
Well-known member
sorry i cant figure it out now...
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
it also says make sure you do not have infinate loop or infinate recursion
il give all code in order that they are executed in
Check the chechbox and it disables all irelevent stuff and populates the combobox
here is the Spray_List sub
it populates the combo box and here is the code in the combobox
the method.invoke is what calls the sub Parking_Sensors
here is the code for the clear list
I Really cant figure this out and im am Totally Baffeled
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
it also says make sure you do not have infinate loop or infinate recursion
il give all code in order that they are executed in
Check the chechbox and it disables all irelevent stuff and populates the combobox
VB.NET:
Private Sub CheckBox_Spray_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox_Spray.CheckedChanged
If Me.CheckBox_Spray.Checked = True Then
Me.ComboBox_Spray.Enabled = True
Me.ComboBox_SSR.Enabled = False
Me.CheckBox_SSR.Checked = False
Me.ComboBox_fiber.Enabled = False
Me.CheckBox_Fiber.Checked = False
Me.ComboBox_Aroma.Enabled = False
Me.CheckBox_Aroma.Checked = False
Me.ComboBox_Glass.Enabled = False
Me.CheckBox_Glass.Checked = False
Me.CheckBox_Walk.Visible = False
Me.Damage_List.Items.Clear()
Call Spray_list()
End If
End Sub
VB.NET:
Private Sub Spray_list()
Call Clear_List()'it doesn't overflow here
Me.Damage_List.Items.Add("Front O/S Bumper Corner")
Me.Damage_List.Items.Add("Front N/S Bumper Corner")
Me.Damage_List.Items.Add("Front Bumper Centre")
Me.Damage_List.Items.Add("Rear O/S Bumper Corner")
Me.Damage_List.Items.Add("Rear N/S Bumper Corner")
Me.Damage_List.Items.Add("Rear Bumper Centre")
Me.Damage_List.Items.Add("Front O/S Wing")
Me.Damage_List.Items.Add("Front N/S Wing")
Me.Damage_List.Items.Add("Rear O/S Quarter Panel")
Me.Damage_List.Items.Add("Rear N/S Quarter Panel")
Me.Damage_List.Items.Add("Front O/S Door")
Me.Damage_List.Items.Add("Front N/S Door")
Me.Damage_List.Items.Add("Rear O/S Door")
Me.Damage_List.Items.Add("Rear N/S Door")
Me.Damage_List.Items.Add("Front O/S Door Sill")
Me.Damage_List.Items.Add("Front N/S Door Sill")
Me.Damage_List.Items.Add("Rear O/S Door Sill")
Me.Damage_List.Items.Add("Rear N/S Door Sill")
Dim executableItems_Spray As New List(Of ExecutableItem)
executableItems_Spray.Add(New ExecutableItem With {.Text = "Standard", .Method = AddressOf Spray_Standard})
executableItems_Spray.Add(New ExecutableItem With {.Text = "Parking Sensors", .Method = AddressOf Spray_Parking_Sensors})
executableItems_Spray.Add(New ExecutableItem With {.Text = "Wing Mirror", .Method = AddressOf Spray_Wing_Mirror})
executableItems_Spray.Add(New ExecutableItem With {.Text = "Door Moulding", .Method = AddressOf Spray_Door_Moulding})
With ComboBox_Spray
.DisplayMember = "Text"
.ValueMember = "Method"
.DataSource = executableItems_Spray
End With
End Sub
VB.NET:
Private Sub ComboBox_Spray_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox_Spray.SelectedIndexChanged
Call clear_Price()'This work's no Error here
method = DirectCast(ComboBox_Spray.SelectedValue, Action)
method.Invoke()
End Sub
VB.NET:
Private Sub Spray_Parking_Sensors()
[COLOR=red]Call Clear_List() ' Here is where the error is at[/COLOR]
Damage_List.Items.Add("Parking Sensors")
Damage_List.SetItemCheckState(0, CheckState.Checked)
Price_Subtotal = 25
Car_Price_Subtotal.Value = Price_Subtotal
Call discount()
VB.NET:
[COLOR=red]Private Sub Clear_List()
If Damage_List.Items.Count > 0 Then
[/COLOR][COLOR=red]Damage_List.Items.Clear()' here is where i get the system.stackOverflowException[/COLOR]
[COLOR=red] End If[/COLOR]
End Sub
Last edited: