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

CornerRadius with IntegerUpDown #1773

Open
Maxim-Paluh opened this issue Mar 1, 2024 · 1 comment
Open

CornerRadius with IntegerUpDown #1773

Maxim-Paluh opened this issue Mar 1, 2024 · 1 comment

Comments

@Maxim-Paluh
Copy link

I tried different ways to modify IntegerUpDown to get rounded edges.
Here are my observations:
IntegerUpDown -> CommonNumericUpDown -> NumericUpDown -> UpDownBase -> InputBase -> InputBase -> Control

NumericUpDown has a Style that indicates that the control consists of a ButtonSpinner x:Name="PART_Spinner" and a WatermarkTextBox x:Name="PART_TextBox"
(in the NumericUpDown class it is specified that [TemplatePart( Name = PART_TextBox, Type = typeof( TextBox ) )])
Everything is clear here

WatermarkTextBox -> AutoSelectTextBox -> TextBox
WatermarkTextBox also has its own Style and defines a new Template for it.
I've been trying to change different Templates in different places throughout the day, but I still can't get the result I want
1

@XceedBoucherS
Copy link
Collaborator

Hi,
From what I can see, there is no direct way to modify the CornerRadius of a NumericUpDown.
We will try to add a property to easily modify this.

In the meantime, if you have access to the source code, here's how a CornerRadius can be set:
In file Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Aero2.NormalColor.xaml,
In style targeting : x:Type local:ButtonSpinner, in the ControlTemplate for x:Type local:ButtonSpinner,
The first Border can have a CornerRadius of 10:
image
This will force a 10 CornerRadius on the 4 sides, but only visible on the lest side since the Up/Down buttons are over the right part.

Then, in the same ControlTemplate, the RepeatButton PART_IncreaseButton has a set style : remove it. then add it's style with a TopRight corner radius of 10:
image

In the same way, for PART_DecreaseButton, you can remove its style and add a new one with a bottomRight Corner Radius:
image

The "chrome" namespace could be used as
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants