GetOrigin

Description

Finds the X and Y coordinates of the upper-left corner of the ListView item.

Applies to

ListView controls

Syntax

listviewname.GetOrigin ( x , y )

Argument

Description

listviewname

The ListView control for which you want to find the coordinates of the upper-left corner

x

An integer variable in which you want to store the X coordinate for the ListView control

y

An integer variable in which you want to store the Y coordinate for the ListView control

Returns

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

Example 1

This example moves a static text clock to the upper-left coordinates of the selected ListView item:

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)+".")