BeginLabelEdit

The BeginLabelEdit event has different arguments for different objects:

Object

See

ListView control

Syntax 1

TreeView control

Syntax 2


Syntax 1: For ListView controls

Description

Occurs when the user clicks on the label of an item after selecting the item.

Event ID

Event ID

Objects

pbm_lvnbeginlabeledit

ListView


Arguments

Argument

Description

index

Integer by value (the index of the selected ListView item)


Return Values

Long.

Return code choices (specify in a RETURN statement):

0 -- Allow editing of the label

1 -- Prevent editing of the label

Usage

When editing is allowed, a box appears around the label with the text highlighted. The user can replace or change the existing text.

Examples

This example uses the BeginLabelEdit event to display the name of the ListView item being edited:

ListViewItem lvi
This.GetItem(index lvi)
sle_info.text = "Editing " + string(lvi.label)

See also

EndLabelEdit

Syntax 2: For TreeView controls

Description

Occurs when the user clicks on the label of an item after selecting the item.

Event ID

Event ID

Objects

pbm_tvnbeginlabeledit

TreeView


Arguments

Argument

Description

handle

Long by value (the handle of the selected TreeView item)


Return Values

Long.

Return code choices (specify in a RETURN statement):

0 -- Allow editing of the label

1 -- Prevent editing of the label

Usage

When editing is allowed, a box appears around the label with the text highlighted. The user can replace or change the existing text.

Examples

This example uses the BeginLabelEdit to display the name of the TreeView item being edited in a SingleLineEdit:

TreeViewItem tvi
This.GetItem(index, tvi)
sle_info.text = "Editing " + string(tvi.label)

See also

EndLabelEdit