You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm starting using new Win 11 theming for my new WPF projects.
I noticed that a "delete button" was added by default in the TextBox control:
Is there a simple way to remove that button, e.g. with a property DisplayDeleteButton? I think this should be customizable to allow easy usage in scenarios that don't require a delete button.
If this has not been implemented yet, I'm available to contribute (but I'd need to be pointed in the right direction).
@fraluderin right now the only way to remove the delete button is to override the template. But your suggestion looks fine we can introduce a property that will control the visibility of the delete button.
You can raise an API proposal for the same. After review we can proceed with the implementation.
@fraluderin , there is a style defined for TextBoxBase in Fluent control styles, DefaultTextBoxBaseStyle. I haven't checked it yet, but this shall load the TextBox without the clear button.
Activity
himgoyalmicro commentedon Dec 16, 2024
@fraluderin right now the only way to remove the delete button is to override the template. But your suggestion looks fine we can introduce a property that will control the visibility of the delete button.
You can raise an API proposal for the same. After review we can proceed with the implementation.
dipeshmsft commentedon Dec 18, 2024
@fraluderin , there is a style defined for TextBoxBase in Fluent control styles,
DefaultTextBoxBaseStyle. I haven't checked it yet, but this shall load the TextBox without the clear button.fraluderin commentedon Jan 6, 2025
@dipeshmsft Yes you're right, I checked it now and it works. I added this in my TextBox XAML:
Style="{StaticResource DefaultTextBoxBaseStyle}"I have no sufficient experience to help you decide which should be the default behavior (show or not the clear button in a TextBox).
dipeshmsft commentedon Jan 9, 2025
Thanks for the update @fraluderin.
I will go ahead and close this issue now, but I will add the reference to this issue is another bug that tracks other Fluent issues.