Q:

How to style Windows Form Labels

I am writing a (purely) PowerShell app to display numbers in a table using Windows Forms
My thought is to create rows of fixed-size labels (or text boxes), which works out just fine. What I am having trouble with is figuring how to make those numbers right-justified within each label field. I see that using XAML there is a "HorizontalContentAlignment" but I can't seem to see the equivalent property in PowerShell. I see there is TextAlign property but that seems to be for Vertical alignment, rather than Horizontal.
Of course, I am open to doing something else (other than table of labels) that'll do the same thing.
Thanks.

A:

Well, You can use the enumerations from System.Drawing.ContentAlignment
$Label = New-Object -TypeName System.Windows.Forms.Label
$Label.Text = 'SomeText'
$Label.TextAlign = [System.Drawing.ContentAlignment]::MiddleRight

How did I find the peroperty ?
$Label | Get-Member -MemberType Property | Where-Object -FilterScript {$_.name -like "*ali*"}

