MaterialDesignInXAML / MaterialDesignInXamlToolkit

Google's Material Design in XAML & WPF, for C# & VB.Net.
http://materialdesigninxaml.net
MIT License
14.82k stars 3.4k forks source link

Disabled style of the TextBox and ComboBox are different #3571

Closed v2codes closed 1 month ago

v2codes commented 1 month ago

Bug explanation

Disabled style of the TextBox and ComboBox box are different. Set the IsEnable property to false, the underline of TextBox is dashed. But the ComboBox is solid. Like this:

Screenshot

image

Code

<TextBox Width="180" Margin="40,0" materialDesign:HintAssist.Hint="disabled" IsEnabled="False" />
<ComboBox Width="180" materialDesign:HintAssist.Hint="please select" materialDesign:HintAssist.IsFloating="False" IsEnabled="False">
    <ComboBoxItem Content="Apple" IsSelected="True" />
</ComboBox>

Framework Version

Version

5.0.0

Keboo commented 1 month ago

I am not able to replicate this with the latest nightly release. Are you able to provide a more complete solution?

From looking at it, it appears in your screenshot that the ComboBox would be the incorrect one with the solid line. The solid line should only be occurring when the ComboBox has the MaterialDesignFilledComboBox style. Is it possible, that your background color is the same, obscuring the difference that would normally be there with the filled style?

v2codes commented 1 month ago

I know why, I using MaterialDesignThemes v5.0.0, MaterialDesignColors v3.1.0-ci633. This causes the style to be different. Upgrade MaterialDesignThemes to 5.0.1-ci633 is ok.

By the way , how can I set Textbox with solid line when it is disabled?
Thank's for your help.

Keboo commented 1 month ago

By the way , how can I set Textbox with solid line when it is disabled? Thank's for your help.

It is not obvious, but the reason for the dashed line is to match the material design spec. If you want a solid line you can set TextFieldAssist.HasFilledTextField="False" and that should disable the dashed line.

v2codes commented 1 month ago

@Keboo Thanks for your reply.