- Row number at specified point
- Details about the elements returned by the treeZone constant
In french: <Arbre>.InfoXY
Returns the element of a TreeView control found at a given position.
Example of TreeView control:
// -- Click on the TREE_TreeView1 control
X, Y are int
X = LoWord(CursorPos())
Y = HiWord(CursorPos())
// Find the number of the row corresponding to the click
RowClick is int
RowClick = TREE_TreeView1.InfoXY(treeLineNumber + treeOriginScreen, X, Y)
// Find the branch name
Branch is string
Branch = TREE_TreeView1.InfoXY(treeBranchName + treeOriginScreen, X, Y)
Trace("You've clicked the branch " + ...
Branch + "(row #" + RowClick + ")")
<Result> = <TreeView control>.InfoXY(<Type of information> , <X> , <Y>)
<Result>: Character string, integer or Integer constant
- Number of the row at specified point, -1 if there is no row.
- Name of the branch at specified point, empty string ("") if there is no branch.
- Type of hovered area. This type corresponds to one of the following constants:
|tizButton||"+ / -" button next to the caption of the TreeView control element.|
|tizCheckmark||Checkmark of element.|
|tizImage||Image displayed in front of the element caption.|
|tizLeft||Space found on the left of element caption.|
|tizOut||Space below the elements of the TreeView control.|
|tizRight||Space found on the right of element caption.|
<TreeView control>: Control name
Name of the TreeView control to be used.
<Type of information>: Constant or combination of constants
Requested type of information:
|treeBranchID||Identifier of element found at (X, Y).|
|treeBranchName||Name of element found at (X, Y).|
|treeLineNumber||Number of the row found at (X, Y).|
|treeOriginScreen||If this option is specified, the origin of specified coordinates corresponds to the screen (and not the TreeView control).|
This constant cannot be used on its own.
|treeZone||Type of hovered area|
X-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the TreeView control (if the treeOriginScreen constant is not specified).
Y-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the TreeView control (if the treeOriginScreen constant is not specified).
Row number at specified point
If the treeLineNumber
constant is used, <TreeView>.InfoXY
returns the number of the row for the specified point. This row number is an "instantaneous" row number, it takes into account all the elements expanded above the row.
This row can be handled by the following syntax:
<TreeView control> [<Number of row to handle>]
Details about the elements returned by the treeZone constant
The following illustration presents the different areas that can be retrieved by the treeZone
This page is also available for…