天天看點

開源C# WPF控件庫---Newbeecoder.UI下拉框

下拉清單的選擇控件,控件左邊顯示文本内容,右邊通過單擊控件上的箭頭來顯示或隐藏該下拉清單,預設的組合框允許選擇一項或文本框中輸入新的文本。

ComboBox是一個ItemsControl,說明由一個或多個集合項組成,可以包括字元串、圖檔等。

Demo下載下傳:

Newbeecoder.UI.zip

根據原型圖設計一款好看的軟體用Newbeecoder.UI能完美實作,先視訊示範Newbeecoder.UI控件庫效果:

視訊内容

控件庫有幾種輸入下拉框。分别有可編輯下拉框、不可編輯帶搜尋功能、帶清除按鈕下拉框、禁用下拉框。

一、可編輯下拉框使用方法:

開源C# WPF控件庫---Newbeecoder.UI下拉框
<TextBlock Text="可編輯" Margin="5"/>
<NbComboBox Style="{DynamicResource DefaultComboBoxStyle}" Margin="5" IsEditable="True" EnabledSearchItems="True" EnabledSearchIgnoreCase="True" ShowClearButton="False">
    <NbComboBoxItem Content="橘子"/>
    <NbComboBoxItem Content="蘋果"/>
    <NbComboBoxItem Content="香蕉"/>
    <NbComboBoxItem Content="草莓"/>
    <NbComboBoxItem Content="梨子"/>
</NbComboBox>           

複制

二、不可編輯帶搜尋功能下拉框使用方法:

開源C# WPF控件庫---Newbeecoder.UI下拉框
<TextBlock Text="不可編輯" Margin="5"/>
<NbComboBox Style="{DynamicResource DefaultComboBoxStyle}" Margin="5" IsEditable="False" EnabledSearchItems="True" EnabledSearchIgnoreCase="True" ShowClearButton="False">
    <NbComboBoxItem Content="橘子"/>
    <NbComboBoxItem Content="蘋果"/>
    <NbComboBoxItem Content="香蕉" IsSelected="True"/>
    <NbComboBoxItem Content="草莓"/>
    <NbComboBoxItem Content="梨子"/>
</NbComboBox>           

複制

三、帶清除按鈕下拉框使用方法:

開源C# WPF控件庫---Newbeecoder.UI下拉框
<TextBlock Text="帶清除按鈕" Margin="5"/>
<NbComboBox Style="{DynamicResource DefaultComboBoxStyle}" Margin="5" IsEditable="False" EnabledSearchItems="True" EnabledSearchIgnoreCase="True" ShowClearButton="True">
    <NbComboBoxItem Content="橘子"/>
    <NbComboBoxItem Content="蘋果"/>
    <NbComboBoxItem Content="香蕉" IsSelected="True"/>
    <NbComboBoxItem Content="草莓"/>
    <NbComboBoxItem Content="梨子"/>
</NbComboBox>           

複制

四、禁用下拉框使用方法:

開源C# WPF控件庫---Newbeecoder.UI下拉框
<TextBlock Text="禁用" Margin="5"/>
<NbComboBox Style="{DynamicResource DefaultComboBoxStyle}" Margin="5" IsEditable="False" EnabledSearchItems="True" EnabledSearchIgnoreCase="True" ShowClearButton="True" IsEnabled="False">
    <NbComboBoxItem Content="橘子"/>
    <NbComboBoxItem Content="蘋果"/>
    <NbComboBoxItem Content="香蕉" IsSelected="True"/>
    <NbComboBoxItem Content="草莓"/>
    <NbComboBoxItem Content="梨子"/>
</NbComboBox>           

複制