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:
N/A
+
{{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()&#x0A;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)&nbsp;&nbsp;Applies the bold style to the text. }}
 +
{{Property | name=FontName | type=String | platform=all | description=(String)&nbsp;&nbsp;Name of the font used to display the text.  }}
 +
{{Property | name=FontSize | type=Single | platform=all | modifiedinversion=2009r4 | description=(Single)&nbsp;&nbsp;Size of the font used to display the text.  }}
 +
{{Property | name=FontUnit | type=FontUnits | platform=all | newinversion=2009r4 | description=(FontUnits)&nbsp;&nbsp;The units in which FontSize is measured. }}
 +
{{Property | name=Italic | type=Boolean | platform=all | description=(Boolean)&nbsp;&nbsp;Applies the italic style to the text. }}
 +
{{Property | name=Multiline | type=Boolean | platform=all | description=(Boolean)&nbsp;&nbsp;If True, wrap text to multiple lines. }}
 +
{{Property | name=Selectable | type=Boolean | platform=cocoa+linux | description=(Boolean)&nbsp;&nbsp;Enables the user to select the Caption property.  }}
 +
{{Property | name=TextAlignment | type=Integer | platform=all | description=(Integer)&nbsp;&nbsp;The alignment of the text.  }}
 +
{{Property | name=TextColor | type=Color | platform=all | description=(Color)&nbsp;&nbsp;The color of the text. }}
 +
{{Property | name=Underline | type=Boolean | platform=all | description=(Boolean)&nbsp;&nbsp;Applies the underline style to the text. }}
 +
{{Property | name=Text | type=String | platform=all | description=(String)&nbsp;&nbsp;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.

Events
AcceleratorKey DropObject MouseEnter
Closing FocusLost MouseExit
ConstructContextualMenu FocusReceived MouseMove
ContextualMenuItemSelected KeyDown MouseUp
DragEnter KeyUp MouseWheel
DragExit MouseDown Opening
DragOver MouseDrag
Properties
Active fa-lock-32.png Left TabIndex
AllowAutoDeactivate LockBottom Text
AllowTabStop LockLeft TextAlignment
Bold LockRight TextColor
Enabled LockTop Tooltip
FontName MouseCursor Top
FontSize Multiline Transparent
FontUnit Name fa-lock-32.png Underline
Handle fa-lock-32.png PanelIndex Visible
Height Parent Width
Index fa-lock-32.png Scope fa-lock-32.png Window fa-lock-32.png
Italic Selectable
Methods
AcceptFileDrop AcceptTextDrop Refresh
AcceptPictureDrop Close SetFocus
AcceptRawDataDrop DrawInto

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.