combobox数据绑定List链表集合区分显示值与选择的值
整体效果:
根据combobox选择情况分别打印选取值与显示值
代码:
Windows窗体:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 <Window x:Class="ComboxBinding.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="ComBox绑定" Height="192.857" Width="385" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"> 5 <Grid> 6 <ComboBox Name="comBox1" HorizontalAlignment="Left" Margin="74,10,0,0" Width="209" Height="22" VerticalAlignment="Top"/> 7 <TextBlock Name="txtSelectedValue" Width="200" Text="