相关疑难解决方法(0)

WPF组合框:文本框和下拉列表中的不同模板

这是我的组合框.

    <ComboBox Height="45" HorizontalAlignment="Left" Margin="184,66,0,0" Name="ComboBox1" VerticalAlignment="Top" Width="216">
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <Label Content="{Binding FullName}" Width="150" />
                    <Label Content="{Binding Title}" Width="100"/>
                    <Label Content="{Binding BranchName}" />
                </StackPanel>
            </DataTemplate>
        </ComboBox.ItemTemplate>
    </ComboBox>
Run Code Online (Sandbox Code Playgroud)

如何更改它,以便只有FullName出现在组合框的文本框部分中,而所有三列仍然出现在下拉部分?

c# wpf xaml combobox

16
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

combobox ×1

wpf ×1

xaml ×1