Autor Beitrag
BlackMatrix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243
Erhaltene Danke: 1



BeitragVerfasst: Do 05.01.12 00:02 
Hi.

Gibt es für das ComboBoxControl ein spezielles Ereignis, dass nur ausgelöst wird, wenn sich die Auswahl auch wirklich ändert? Wenn mein Benutzer das die DropDownList aufmacht und das selbe Element wieder anwählt, soll kein Ereignis ausgelöst werden.

Oder muss ich SelectionChangeCommitted abbonieren und im Falle, dass er das selbe Element wieder auswählt oder wegklickt die Bearbeitung einfach abfangen?

LG
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4798
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Do 05.01.12 11:37 
Hallo BlackMatrix,

SelectedIndexChanged sollte eigentlich wirklich nur bei einer Änderung ausgelöst werden (und nicht bei nochmaliger Auswahl).
SelectionChangeCommitted wird bei jeder expliziten Auswahl des Benutzers ausgelöst (egal, ob Änderung oder nicht).
BlackMatrix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243
Erhaltene Danke: 1



BeitragVerfasst: Do 05.01.12 14:41 
user profile iconTh69 hat folgendes geschrieben Zum zitierten Posting springen:
Hallo BlackMatrix,

SelectedIndexChanged sollte eigentlich wirklich nur bei einer Änderung ausgelöst werden (und nicht bei nochmaliger Auswahl).
SelectionChangeCommitted wird bei jeder expliziten Auswahl des Benutzers ausgelöst (egal, ob Änderung oder nicht).


Macht beides leider keinen Unterschied.

Alle 3 SelectedEreignisse (SelectionChangeCommitted, SelectedValueChanged, SelectedIndexChanged) reagieren, wenn man das gleiche Element wieder auswählt, dass vorher schon drin stand und keines der Ereignisse reagiert, wenn man die DropDownList aufmacht und irgendwo anders hinklickt ohne ein Element auszuwählen.
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4798
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Do 05.01.12 17:31 
Tja, dann wirst du dir wohl den aktuellen SelectedIndex merken müssen und selber entsprechend vergleichen.
BlackMatrix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243
Erhaltene Danke: 1



BeitragVerfasst: Do 05.01.12 17:52 
Dank dir.