alterneuersack
Goto Top

ListBox SelectedValue - Problem

Ich habe das Problem das mir zu fiel info mit SelectedValue ausgegeben wird.

textausgabe.Text = kategorie_eingang.SelectedValue.ToString();

Es tut was es soll aber die Ausgabe sieht volgender massen aus:

System.Windows.Controls.ListBoxItem: Arbeit

Ähmm, ich möchte aber doch nur "Arbeit" als String.
Warum passiert dass so und nicht wie ich es will ?

Für Aufklärung wäre ich dankbar.

Content-Key: 33790147557

Url: https://administrator.de/contentid/33790147557

Printed on: April 28, 2024 at 06:04 o'clock

Mitglied: 7907292512
7907292512 Sep 30, 2023 updated at 05:53:19 (UTC)
Goto Top
Du wandelst das ganze Objekt zu einem String statt nur den Inhalt abzufragen
"Content" is your friend ..

RTFM https://learn.microsoft.com/de-de/dotnet/api/system.windows.controls.lis ...

textausgabe.Text = kategorie_eingang.SelectedValue.Content;
Sid.