Label
property for PowerScript controls
Applies to
grAxis objects in Graph controls, ListViewItem objects, TreeViewItem
objects, RibbonComboBoxItem objects
Description
Within graphs
The Label property specifies the label of an axis of the
graph.
Within ListView, TreeView, RibbonBar
controls
The Label property specifies the label associated with a
ListViewItem, TreeViewItem, or RibbonComboBoxItem object. You cannot
manipulate items in TreeView controls in a painter. You must write scripts
to add items to a TreeView.
Usage
In a painter
To specify an Axis label in a graph control:
-
Display the Axis tab page of the graph control’s Properties
view. -
Select the desired axis from the Axis drop-down list.
-
Enter the label text in the Label text field.
To specify labels for items in a ListView control:
-
Display the Items tab page of the ListView control’s Properties
view. -
For each item, enter label text in the appropriate Text
field.
In scripts
The Label property takes a string value. The following example sets
text for the label on the Values axis of graph gr_1.
|
1 |
gr_1.Values.Label = 'Lawsuits per 1000' |
To add or insert an item with a label into a ListView control, use
the AddItem or InsertItem functions. For example, this line adds an item
to ListView control lv_1, specifying the label and picture index for the
item:
|
1 |
lv_1.AddItem ( "Oranges", 1) |
To change the label, get the item from the ListView and set the
item’s Label property:
|
1 2 3 4 |
ListViewItem lvi lv_1.GetItem(4, lvi) lvi.Label = "Apples" lv_1.SetItem(4, lvi) |
To add or insert items in a TreeView control, use the InsertItem,
InsertItemFirst, InsertItemLast, or InsertItemSort functions.
For more information, see the section called “Using TreeView Controls” in Application Techniques and the section called “Using
ListView controls” in Application Techniques.