NumberBox TextAlignment property is missing
See original GitHub issueDescribe the bug
I want to center the text inside a NumberBox, but the TextAlignment property available in this documentation can’t be used with WinUI 3.
Steps to reproduce the bug
- Use a NumberBox control with WASDK 1.1 and WinUI3.
- Try to use the TextAlignment property, spoiler alert: not available!
<NumberBox Width="100" Value="10" TextAlignment="Center"></NumberBox>
Expected behavior
I expect the property to be available for use as it’s part of the documentation and also added in WinUI library two years ago according to this PR.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.1.2
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
Windows Insider Build (xxxxx)
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Proposal: Add TextAlignment property to NumberBox #1722
Creating a Template for the NumberBox with only this extra property is a lot of work. Do-able but not nice. <TextBox x:Name="InputBox" Grid....
Read more >NumberBox.TextAlignment Property
NumberBox.TextAlignment in the Microsoft.UI.Xaml.Controls namespace. ... NumberBox.TextAlignment Property. Reference. Feedback ...
Read more >Text alignment within devextreme numberbox
Hi, I'm using the numberbox in my current project. Everything is working fine, only the text alignment does not work in the way...
Read more >Flutter - TextField "textAlign" property not found
I have this basic textfield: new TextField( style: new TextStyle(fontSize: 20.0, color: Colors.blue), onChanged: (InputValue newInputValue) { ...
Read more >text-align
The text-align property in CSS is used for aligning the inner content of a block element.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For those who needs this immediately, I have published NumberBoxEx for this. You can get it as NuGet package.
I just found that this has been asked before in https://github.com/microsoft/microsoft-ui-xaml/issues/4697
There’s a suggestion there for if you want this right away: https://github.com/microsoft/microsoft-ui-xaml/issues/4697#issuecomment-810640121
I’m going to close this issue as a dupe of that one, just because the other issue already has an internal task tracking it (https://task.ms/32309254). I’m going to continue to work on getting this API promoted to stable.