question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NumberBox TextAlignment property is missing

See original GitHub issue

Describe 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

  1. Use a NumberBox control with WASDK 1.1 and WinUI3.
  2. 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:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AndrewKeepCodingcommented, May 9, 2023

For those who needs this immediately, I have published NumberBoxEx for this. You can get it as NuGet package.

1reaction
krschaucommented, Jul 21, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found