paulthepaddy
Well-known member
hey guys im using this code
The code in blue is being used for calling methods but how can i do the following
i am getting this error if i do the above code
'AddressOf' operand must be the name of a method (without parentheses).
how can i Call a sub WHILE passing values to the sub il show the dataflow as such
user selects an option from a combobox which determins which sub to call then a checkedlistbox.itemchecked event passes the values to the sub and executes the sub.
need any more info just ask
VB.NET:
If Me.CheckBox_SSR.Checked = True Then
Me.ComboBox_SSR.Enabled = True
Me.ComboBox_Spray.Enabled = False
Me.CheckBox_Spray.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
Dim executableitems_SSR As New List(Of ExecutableItem)
[COLOR=#0000ff] executableitems_SSR.Add(New ExecutableItem With {.Text = "Scratch", .Method = AddressOf SSR_Scratches})
executableitems_SSR.Add(New ExecutableItem With {.Text = "Stone Chip", .Method = AddressOf SSR_Stone_chips})
executableitems_SSR.Add(New ExecutableItem With {.Text = "Walk Around", .Method = AddressOf SSR_Walk})[/COLOR]
With ComboBox_SSR
.DisplayMember = "Text"
.ValueMember = "Method"
.DataSource = executableitems_SSR
End With
End If
VB.NET:
[COLOR=#0000FF]executableitems_SSR.Add(New ExecutableItem With {.Text = "Scratch", .Method = AddressOf [/COLOR][COLOR=#ff0000]SSR_Scratches(Damage_List.CheckedItems, ComboBox_Current_Car.SelectedItem)[/COLOR][COLOR=#0000ff]})[/COLOR]
i am getting this error if i do the above code
'AddressOf' operand must be the name of a method (without parentheses).
how can i Call a sub WHILE passing values to the sub il show the dataflow as such
user selects an option from a combobox which determins which sub to call then a checkedlistbox.itemchecked event passes the values to the sub and executes the sub.
need any more info just ask