Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# Wie mit EventArgs arbeiten?

Empfohlene Antworten

Veröffentlicht

Holla,

Kann mir jemand erklären wie ich mit EventArgs umgehen muss?

Ich schreibe grad ein Programm in dem das Event ListView.SelectedIndexChanged auftaucht. Im EventHandler möchte ich nun natürlich wissen welcher Index sich geändert hat.

Es werden zwei Parameter übergeben: object Sender und EventArgs e. Ich nehme an, dass der gesuchte Index in e zu finden ist. Ich weiß aber nicht so recht wie ich damit umgehen muss.

Was muss ich mit e machen, um an die Werte heranzukommen?

Vielen Dank im Voraus.

Wie ich schon vermutet hatte, muss man EventArgs e konvertieren.

Ich denke so müsse es funktionieren:


SelectionChangedEventArgs parameter = (SelectionChangedEventArgs)e;

Allerdings gibt es SelectionChangedEventArgs wohl erst ab .Net 3.0 und befindet sich in System.Windows.Controls. Habe jetzt mal ein Update auf 3.5 gemacht. Funktioniert leider immer noch nicht.

Muss ich etwas bestimmtes tun damit ich an die Klassen von 3.5 herankomme?

Ich meine außer using. Der Namespace System.Windows.Controls ist nicht bekannt!

  • 2 Wochen später...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.