Difference between revisions of "DesktopLabel"
From Xojo Documentation
(Created page with "N/A") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{ClassBox | |
+ | | super=[[DesktopUIControl]] | ||
+ | | scope=global | ||
+ | | newinversion=2021r3 | ||
+ | }} | ||
+ | {{Description | ||
+ | | text=Displays read-only text. }} | ||
+ | |||
+ | <dynamicTable id="Events" super="DesktopUIControl" class="eventTable" title="Events" columns="3"> | ||
+ | {{Event | name=AcceleratorKey | description=AcceleratorKey()
The accelerator key for the Label was pressed. }} | ||
+ | </dynamicTable> | ||
+ | |||
+ | <dynamicTable id="Properties" super="DesktopUIControl" class="propertyTable" title="Properties" columns="3" > | ||
+ | {{Property | name=Bold | type=Boolean | platform=all | description=(Boolean) Applies the bold style to the text. }} | ||
+ | {{Property | name=FontName | type=String | platform=all | description=(String) Name of the font used to display the text. }} | ||
+ | {{Property | name=FontSize | type=Single | platform=all | modifiedinversion=2009r4 | description=(Single) Size of the font used to display the text. }} | ||
+ | {{Property | name=FontUnit | type=FontUnits | platform=all | newinversion=2009r4 | description=(FontUnits) The units in which FontSize is measured. }} | ||
+ | {{Property | name=Italic | type=Boolean | platform=all | description=(Boolean) Applies the italic style to the text. }} | ||
+ | {{Property | name=Multiline | type=Boolean | platform=all | description=(Boolean) If True, wrap text to multiple lines. }} | ||
+ | {{Property | name=Selectable | type=Boolean | platform=cocoa+linux | description=(Boolean) Enables the user to select the Caption property. }} | ||
+ | {{Property | name=TextAlignment | type=Integer | platform=all | description=(Integer) The alignment of the text. }} | ||
+ | {{Property | name=TextColor | type=Color | platform=all | description=(Color) The color of the text. }} | ||
+ | {{Property | name=Underline | type=Boolean | platform=all | description=(Boolean) Applies the underline style to the text. }} | ||
+ | {{Property | name=Text | type=String | platform=all | description=(String) The text displayed. }} | ||
+ | </dynamicTable> | ||
+ | |||
+ | <dynamicTable id="Methods" super="DesktopUIControl" class="methodTable" title="Methods" columns="3"> | ||
+ | </dynamicTable> | ||
+ | |||
+ | ==Notes== | ||
+ | You can define an accelerator character for a '''DesktopLabel'''. In the [[DesktopLabel.Text|Text]] property, precede the accelerator character with an ampersand. For example, the entry "&Home" signifies that the H is the accelerator. Pressing Alt+H on Windows triggers the [[DesktopLabel.AcceleratorKey|AcceleratorKey]] event. | ||
+ | |||
+ | Labels on macOS are not meant to ever appear disabled. As a result, the [[DesktopUIControl.Enabled|Enabled]] property of a Label has no effect on macOS. | ||
+ | |||
+ | ==Sample Code== | ||
+ | The following code sets the text of the '''Label''': | ||
+ | <rbcode> | ||
+ | Me.Text = "Hello World" | ||
+ | </rbcode> | ||
+ | |||
+ | ==See Also== | ||
+ | [[DesktopUIControl]] class; [[DesktopTextArea]], [[DesktopTextField]] control. | ||
+ | |||
+ | [[Category:Desktop]] | ||
+ | [[Category:Desktop Controls]] |
Latest revision as of 23:37, 27 January 2022
Class (inherits from DesktopUIControl)
New in 2021r3
Displays read-only text.
Properties | |||||||||||||||||||||||||||||||||||
|
Methods | ||||||||
|
Notes
You can define an accelerator character for a DesktopLabel. In the Text property, precede the accelerator character with an ampersand. For example, the entry "&Home" signifies that the H is the accelerator. Pressing Alt+H on Windows triggers the AcceleratorKey event.
Labels on macOS are not meant to ever appear disabled. As a result, the Enabled property of a Label has no effect on macOS.
Sample Code
The following code sets the text of the Label:
Me.Text = "Hello World"
See Also
DesktopUIControl class; DesktopTextArea, DesktopTextField control.