Skip to content

HC extension of native combobox.

cs
public class ComboBox : System.Windows.Controls.ComboBox, IDataInput

Attributes ​

PropertyDescriptionDefault ValueRemarks
AutoCompleteWhether to automatically complete the inputfalse
SelectionTextBrush
SelectionOpacity
SelectionBrush
CaretBrushProperty

Additional attributes ​

AttributeDescriptionDefault ValueRemarks
InfoElement.PlaceholderPlaceholder
InfoElement.NecessaryIs it requiredfalse
InfoElement.SymbolRequired mark●
InfoElement.ContentHeightContent Height30Available when the title is above
InfoElement.MinContentHeightMinimum content height30Available when the title is on top
TitleElement.TitleTitle
TitleElement.TitlePlacementTitle AlignmentTitlePlacementType.Top
TitleElement.TitleWidthTitleWidth120
DropDownElement.ConsistentWidthWhether the drop-down content is the same as the width of the drop-down boxfalse

Style ​

StyleDescription
ComboBoxPlusBaseStyleDefault Style
ComboBoxPlus.Small

Case ​

The native functions behave the same on the extended ComboBox.

xml
<hc:ComboBox>
    <hc:ComboBoxItem Content="Item 1"/>
    <hc:ComboBoxItem Content="Item 2"/>
    <hc:ComboBoxItem Content="Item 3"/>
</hc:ComboBox>

Or

xml
<StackPanel Margin="32">
    <hc:ComboBox ShowClearButton="True" ItemsSource="{Binding DataList}" SelectedIndex="0"/>
    <hc:ComboBox ItemsSource="{Binding DataList}" Margin="0,16,0,0" SelectedIndex="0" IsEnabled="False"/>
    <hc:ComboBox ShowClearButton="True" ItemsSource="{Binding DataList}" SelectedIndex="0" Margin="0,16,0,0" IsEditable="True"/>
    <hc:ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" hc:InfoElement.Title="This is the title" Margin="0,32,0,0" Text="This is the content"/>
    <hc:ComboBox ShowClearButton="True" ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="This is placeholder" hc:InfoElement.Title="This is the title" hc:InfoElement.Necessary="True" Margin="0,32,0,0"/>
    <hc:ComboBox ItemsSource="{Binding DataList}" IsEditable="True" SelectedIndex="0" hc:InfoElement.Title="This is the title" Margin="0,32,0,0" Text="This is the content"/>
    <hc:ComboBox AutoComplete="True" ShowClearButton="True" ItemsSource="{Binding DataList}" IsEditable="True" hc:InfoElement.Placeholder="This is placeholder" hc:InfoElement.Title="This is the title" hc:InfoElement.Necessary="True" Margin="0,32,0,0"/>
    <hc:ComboBox ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="This is the title" Margin="0,32,0,0" Text="This is the content"/>
    <hc:ComboBox ShowClearButton="True" ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="This is placeholder" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="This is the title" hc:InfoElement.Necessary="True" Margin="0,32,0,0"/>
    <hc:ComboBox ItemsSource="{Binding DataList}" IsEditable="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="This is the title" Margin="0,32,0,0" Text="This is the content"/>
    <hc:ComboBox AutoComplete="True" ShowClearButton="True" ItemsSource="{Binding DataList}" IsEditable="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="This is placeholder" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="This is the title" hc:InfoElement.Necessary="True" Margin="0,32,0,0"/>
</StackPanel>

ComboBox

Released under the MIT License.