What is the value of the Default enumeration in Label?

I have a label and want to return to text alignment.
Since it is not possible to return an Enum.
This doesn’t work:

Return Label1.TextAlignment

So, I have to convert these Enums to Integers.
When I look in the documentation I see.

TextAlignment Enumeration
Left = 0
Center = 1
Right = 2

And

TextAlignments
Default
Left
Center
Right

What is the value of the enum for Default?

Select Case Label1.TextAlignment
Case TextAlignments.Default
  Return ?
Case TextAlignments.Left
  Return 0
Case TextAlignments.Center
  Return 1
Case TextAlignments.Right
  Return 2
End Select

I’d assume it’s the System default. But the LR says for the TextEdit Control

Currently the Default alignment is the same as Left aligned.

:man_shrugging:

 Function TextAlignmentToInteger(value as TextAlignments) As Integer
 Return Integer(value)
 End Function

i will probably return 0 or -1

@DerkJ
Thank you.
That makes it even a lot easier. :wink: :grinning:
I can do:

Return Integer(Label1.TextAlignment)
1 Like

Or an extention:

 Function ToInteger(Extends value as TextAlignments) As Integer
 Return Integer(value)
 End Function

Now you can use TheTextAlignment.ToInteger

Var myVal As Integer = Label1.TextAlignment.ToInteger

And back:

 Function FromInteger(Extends value as Integer) As TextAlignment
 Select Case value
 Case 0 
 Return TextAlignments.Left //?
 Case 1
 Return TextAlignments.Center //?
 Case 2
 Return TextAlignments.Right //?
 Else
 Return TextAlignments.Default
 End Select
 End Function

Why would you think this is the case?

Because when I try to assign an Enum/ Enumeration as type to a computed property (TextAlign) it is not possible.
Enum gives the error message:

Label1.TextAlign Declaration
Syntax error
Property TextAlign As Enum

Enumeration gives the error message:

Label1.TextAlign Declaration
Cant find a type with this name
Property TextAlign As Enumeration

Uh yeah, it should be

TextAlign as TextAlignments

:blush: