前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >开源C# WPF控件库---Newbeecoder.UI下拉框

开源C# WPF控件库---Newbeecoder.UI下拉框

原创
作者头像
用户7152477
修改2022-05-05 11:56:20
1.2K0
修改2022-05-05 11:56:20
举报
文章被收录于专栏:CSharp编程CSharp编程

下拉列表的选择控件,控件左边显示文本内容,右边通过单击控件上的箭头来显示或隐藏该下拉列表,默认的组合框允许选择一项或文本框中输入新的文本。

ComboBox是一个ItemsControl,说明由一个或多个集合项组成,可以包括字符串、图片等。 Demo下载:

Newbeecoder.UI.zip

根据原型图设计一款好看的软件用Newbeecoder.UI能完美实现,先视频演示Newbeecoder.UI控件库效果:

视频内容

控件库有几种输入下拉框。分别有可编辑下拉框、不可编辑带搜索功能、带清除按钮下拉框、禁用下拉框。

一、可编辑下拉框使用方法:

代码语言:html
复制
<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>

二、不可编辑带搜索功能下拉框使用方法:

代码语言:html
复制
<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>

三、带清除按钮下拉框使用方法:

代码语言:html
复制
<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>

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

代码语言:html
复制
<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>

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档