Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete button in Win 11 themed TextBox #10180

Open
fraluderin opened this issue Dec 15, 2024 · 2 comments
Open

Delete button in Win 11 themed TextBox #10180

fraluderin opened this issue Dec 15, 2024 · 2 comments
Assignees

Comments

@fraluderin
Copy link

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:

Image

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).

@himgoyalmicro
Copy link
Contributor

@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.

@himgoyalmicro himgoyalmicro added API suggestion Early API idea and discussion, it is NOT ready for implementation and removed Untriaged labels Dec 16, 2024
@dipeshmsft
Copy link
Member

dipeshmsft commented 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.

    <TextBox Style="{StaticResource DefaultTextBoxBaseStyle}" Width="200" Height="50" Margin="5" />

@dipeshmsft dipeshmsft added Win 11 Theming and removed API suggestion Early API idea and discussion, it is NOT ready for implementation labels Dec 18, 2024
@dipeshmsft dipeshmsft self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants