Gibt es eine möglichkeit Code vom ausführen zu verhindern wenn eine If-Abfrage gelungen ist?
Wenn nicht habe ich ein kleines Problem:
Theoretisch soll bei jedem Doppelklick ein Teil des Textes eines Items in einer Listbox geändert werden: von soon auf live, von live auf done, von done auf canceled und von canceled wieder auf soon.
Jedoch wird bei dem Beispiel oben nie soon da stehen weil es direkt wieder von der letzten If-Abfrage geändert wird. Bitte hilft mir, bin am verzweifeln..
Wenn nicht habe ich ein kleines Problem:
Quellcode
- If ListBox1.Items(ListBox1.SelectedIndex).ToString.Contains("canceled") Then
- ListBox1.Items(ListBox1.SelectedIndex) = ListBox1.Items(ListBox1.SelectedIndex).ToString.Replace("canceled", "soon")
- End If
- If ListBox1.Items(ListBox1.SelectedIndex).ToString.Contains("done") Then
- ListBox1.Items(ListBox1.SelectedIndex) = ListBox1.Items(ListBox1.SelectedIndex).ToString.Replace("done", "canceled")
- End If
- If ListBox1.Items(ListBox1.SelectedIndex).ToString.Contains("live") Then
- ListBox1.Items(ListBox1.SelectedIndex) = ListBox1.Items(ListBox1.SelectedIndex).ToString.Replace("live", "done")
- End If
- If ListBox1.Items(ListBox1.SelectedIndex).ToString.Contains("soon") Then
- ListBox1.Items(ListBox1.SelectedIndex) = ListBox1.Items(ListBox1.SelectedIndex).ToString.Replace("soon", "live")
- End If
Theoretisch soll bei jedem Doppelklick ein Teil des Textes eines Items in einer Listbox geändert werden: von soon auf live, von live auf done, von done auf canceled und von canceled wieder auf soon.
Jedoch wird bei dem Beispiel oben nie soon da stehen weil es direkt wieder von der letzten If-Abfrage geändert wird. Bitte hilft mir, bin am verzweifeln..