Put a label in a ListView or TreeView control into edit mode.
To enable editing of a label in a |
Use |
---|---|
ListView control |
|
TreeView control |
Puts a label in a ListView into edit mode.
ListView controls
listviewname.EditLabel ( index )
Argument |
Description |
---|---|
listviewname |
The ListView control in which you want to enable label editing |
index |
The index of the ListView item to be edited |
Integer. Returns 1 if it succeeds and -1 if an error occurs.
The EditLabels property for the ListView must be set to true to enable editing of labels. When this property is true, calling the EditLabel function sets focus on the item and enables editing. To disable editing when the user has finished editing the label, set the EditLabels property to false in the EndLabelEdit event.
If the EditLabels property is set to false, the EditLabel function does not enable editing.
This example allows the user to edit the label of the first selected item in the ListView control lv_1:
integer li_selected li_selected = lv_1.SelectedIndex() lv_1.EditLabels = TRUE lv_1.EditLabel(li_selected)
Puts a label in a TreeView into edit mode.
TreeView controls
treeviewname.EditLabel ( itemhandle )
Argument |
Description |
---|---|
treeviewname |
The TreeView control in which you want to enable label editing |
itemhandle |
The handle of the item to be edited |
Integer. Returns 1 if it succeeds and -1 if an error occurs.
The EditLabels property for the TreeView must be set to true to enable editing of labels. When this property is true, calling the EditLabel function sets focus on the item and enables editing. To disable editing when the user has finished editing the label, set the EditLabels property to false in the EndLabelEdit event.
If the EditLabels property is set to false, the EditLabel function does not enable editing.
This example allows the user to edit the label of the current TreeView item:
long ll_tvi
ll_tvi = tv_list.FindItem(CurrentTreeItem!, 0)
tv_list.EditLabels = TRUE
tv_list.EditLabel(ll_tvi)