GetOrigin
PowerScript function
Description
Finds the X and Y coordinates of the upper-left corner of the
ListView item.
Applies to
ListView controls
Syntax
|
1 |
listviewname.GetOrigin ( x , y ) |
|
Argument |
Description |
|---|---|
|
listviewname |
The ListView control for which you want to find the |
|
x |
An integer variable in which you want to store the X |
|
y |
An integer variable in which you want to store the Y |
Return value
Integer.
Returns 1 if it succeeds and -1 if it fails.
Usage
Use GetOrigin to find the position of a dragged object relative to
the upper left corner of a ListView control.
Examples
This example moves a static text clock to the upper-left coordinates
of the selected ListView item:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
integer li_index listviewitem l_lvi li_index = lv_list.SelectedIndex() lv_list.GetItem(li_index, l_lvi) lv_list.GetOrigin(l_lvi.ItemX, l_lvi.ItemY) sle_info.Text = "X is "+ String(l_lvi.ItemX) & + " and Y is " + String(l_lvi.ItemY) st_clock.Move(l_lvi.itemx , l_lvi.ItemY) MessageBox("Clock Location", "X is " & + String(st_clock.X) & + ", and Y is " & + String(st_clock.Y)+".") |