I've borrowed from my days in electronics to come up
with a solution to what I think you are attempting.
Correct me if I'm wrong.
In electronics, there is a circuit called a "Schmidt Trigger",
which has the ability to control and shape the profile of a signal.
Well, knowing that there are similar usages in
computer theory, and wanting to implement a structure
that would shave off many processor cycles from
list box processing, I came up with the following.
I'll leave it to you to implement the actual move
and state saving functionality.
This was fun!
Darrell
[tt]
Local o
o = CREATEOBJECT("listbox_schmidt_trigger"

o.SHOW()
Read EVENTS
**************************************************
*-- Class Library:
*-- ..\tektip answers\listbox_schmidt_trigger.vcx
**************************************************
*-- Author: Darrell C. Greenhouse
*-- 2004.02.06
*--
**************************************************
*-- Class: listbox_schmidt_trigger
*-- (..\tektip answers\listbox_schmidt_trigger.vcx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/06/04 05:27:11 PM
*-- A method to implement a self moving list box.
*
*
Define CLASS listbox_schmidt_trigger AS FORM
DoCreate = .T.
DataSession = 2
Height = 377
Width = 625
AutoCenter = .T.
BorderStyle = 2
Caption = ['A "ListBox" self-mover using a Quasi - Software Schmidt Trigger']
Name = "frmListBoxMoverExample"
Add OBJECT lstSelfMover AS LISTBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 12, ;
HEIGHT = 213, ;
LEFT = 25, ;
TOP = 24, ;
WIDTH = 576, ;
INTEGRALHEIGHT = .T., ;
NAME = "lstSelfMover"
Add OBJECT txtTriggerPosition AS TEXTBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
HEIGHT = 24, ;
LEFT = 110, ;
TOP = 259, ;
WIDTH = 72, ;
INTEGRALHEIGHT = .T., ;
NAME = "txtTriggerPosition"
Add OBJECT label1 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 14, ;
BACKSTYLE = 0, ;
CAPTION = "Ths List!", ;
HEIGHT = 24, ;
LEFT = 25, ;
TOP = 3, ;
WIDTH = 70, ;
NAME = "Label1"
Add OBJECT label2 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
BACKSTYLE = 0, ;
CAPTION = ".nStartValue", ;
HEIGHT = 18, ;
LEFT = 25, ;
TOP = 262, ;
WIDTH = 67, ;
NAME = "Label2"
Add OBJECT txtTriggerTrap AS TEXTBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
HEIGHT = 24, ;
LEFT = 110, ;
TOP = 286, ;
WIDTH = 72, ;
INTEGRALHEIGHT = .T., ;
NAME = "txtTriggerTrap"
Add OBJECT txtBeginPosition AS TEXTBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
HEIGHT = 24, ;
LEFT = 110, ;
TOP = 312, ;
WIDTH = 72, ;
INTEGRALHEIGHT = .T., ;
NAME = "txtBeginPosition"
Add OBJECT txtEndPosition AS TEXTBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
HEIGHT = 24, ;
LEFT = 110, ;
TOP = 338, ;
WIDTH = 72, ;
INTEGRALHEIGHT = .T., ;
NAME = "txtEndPosition"
Add OBJECT label3 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
BACKSTYLE = 0, ;
CAPTION = ".nTriggerValue", ;
HEIGHT = 18, ;
LEFT = 25, ;
TOP = 289, ;
WIDTH = 81, ;
NAME = "Label3"
Add OBJECT label4 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
BACKSTYLE = 0, ;
CAPTION = ".nStartPosition", ;
HEIGHT = 18, ;
LEFT = 25, ;
TOP = 315, ;
WIDTH = 81, ;
NAME = "Label4"
Add OBJECT label5 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 10, ;
BACKSTYLE = 0, ;
CAPTION = ".nEndPosition", ;
HEIGHT = 18, ;
LEFT = 25, ;
TOP = 341, ;
WIDTH = 77, ;
NAME = "Label5"
Add OBJECT edtOpInfo AS EDITBOX WITH ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 16, ;
HEIGHT = 104, ;
LEFT = 204, ;
TOP = 259, ;
WIDTH = 396, ;
INTEGRALHEIGHT = .T., ;
NAME = "edtOpInfo"
Add OBJECT label6 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 12, ;
BACKSTYLE = 0, ;
CAPTION = "ListBox internal properties", ;
HEIGHT = 22, ;
LEFT = 25, ;
TOP = 235, ;
WIDTH = 161, ;
NAME = "Label6"
Add OBJECT label7 AS LABEL WITH ;
AUTOSIZE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 12, ;
BACKSTYLE = 0, ;
CAPTION = "Operational information", ;
HEIGHT = 22, ;
LEFT = 204, ;
TOP = 235, ;
WIDTH = 144, ;
NAME = "Label7"
** THIS Method **
** should be implemented by the listbox itself
** Did it here for expediency
Procedure processmove
Lparam oListBox
This.edtOpInfo.VALUE = ;
"List box item at row " + TRANSFORM(oListBox.nBeginPosition) + ;
" moved to row " + TRANSFORM(oListBox.nEndPosition)
Endproc
Procedure INIT
Select * ;
FROM (_samples+"\data\customer.dbf"

;
ORDER BY TITLE ;
INTO CURSOR tmpcust
With THIS
Scan
.lstSelfMover.ADDITEM(company)
Endscan
.txtTriggerPosition.CONTROLSOURCE = "thisform.lstSelfMover.nTriggerPosition"
.txtTriggerTrap.CONTROLSOURCE = "thisform.lstSelfMover.nTriggerTrap"
.txtBeginPosition.CONTROLSOURCE = "thisform.lstSelfMover.nBeginPosition"
.txtEndPosition.CONTROLSOURCE = "thisform.lstSelfMover.nEndPosition"
Endwith
Endproc
Procedure DESTROY
This.SaveState()
Clear EVENTS
Endproc
Procedure SaveState()
* Implement the order of the
* list box. Once again, the listbox
* should probably implement it.
*...
*...
*...
Endproc
Procedure lstSelfMover.MOUSEUP
Lparameters nButton, nShift, nXCoord, nYCoord
With THIS
.nBeginPosition = .nTriggerPosition
.nEndPosition = .LISTINDEX
.PARENT.REFRESH() && Demo
Thisform.ProcessMove(THIS)
.nTriggerTrap = 1
.nTriggerPosition = 0
.bNewTrap = .T. && For demostration only
.PARENT.REFRESH() && Demo
Endwith
Endproc
Procedure lstSelfMover.INIT
With THIS
.ADDPROPERTY("nTriggerPosition",0) && Initially selected row
.ADDPROPERTY("nTriggerTrap",1) && Traps the row
.ADDPROPERTY("nBeginPosition",0) && Beginning position for move
.ADDPROPERTY("nEndPosition",0) && Ending position for move
* This property is only for demontration
* purposes. It facilitates screen refreshing
* of the internal properties
.ADDPROPERTY("bNewTrap",.T.)
Endwith
Endproc
Procedure lstSelfMover.PROGRAMMATICCHANGE
With THIS
* Catch the trailing edge...
.nTriggerPosition = ;
IIF(.nTriggerTrap == 1, .LISTINDEX, .nTriggerPosition)
* And lock it!
.nTriggerTrap = BITRSHIFT(.nTriggerTrap ,1)
If .nTriggerTrap==0 .AND. .bNewTrap
.bNewTrap = .F.
Thisform.REFRESH()
Endif
Endwith
Endproc
Enddefine
*
*-- EndDefine: listbox_schmidt_trigger
**************************************************
[/tt]