C #, WPF-- get combobox option value

Using the Event:
By SelectionChange event. The value selected by the event can be obtained. Timely access to the value of the state change. Bycomlevels.SelectedValue.ToString()
value obtained change. But this time there will beSystem.Windows.Controls.ComboBoxItem: texta prefix, as the argument is not applicable. At this time, usingreplacea function to replace the prefix. At this parameter will get what we want
Here Insert Picture Description

Published 92 original articles · won praise 16 · views 30000 +

Guess you like

Origin blog.csdn.net/weixin_41851906/article/details/104033364