I want to update a control based on a value e.g:
if (StringName == StringName2)
ListBox1.Items.Add("send data");
else if (StringName3 == StringName4)
DifferentListBox.Items.Add("send data");
else if (StringName5 == StringName3)
AnotherListBox.Items.Add("send data");
Or done using a switch statement and so on another 20 times for example.
Is it possible to put these methods (OneOfTheListBoxes.Items.Add("send data") to be put
in a dictionary so i only need to enter the key to action the method instead of iterating through each statement.
Or can you point me to a practice that would make me achieve this? Or how to achieve this in less code?