Article ID: 139958
Article Last Modified on 8/26/1999
***START of the MoverBar Program
*
* Change the following lines up to the next set of
* asterisks into comments to prevent creating a new table each
* time this program is executed.
SELECT DISTINCT city, 100 ;
FROM SYS(2004)+"\samples\data\customer" ;
INTO table MyCity
REPLACE ALL exp_2 WITH RECNO()
GO TOP
****************
frmMoverBar = CREATEOBJECT("moverbar")
frmMoverBar.show
READ EVENTS
RELEASE ALL
**************************************************
*-- Class: moverbar
*-- ParentClass: form
*-- BaseClass: form
*
DEFINE CLASS moverbar AS form
Top = 3
Left = 17
Height = 275
Width = 500
DoCreate = .T.
Caption = "Mover Bar Example"
Name = "frmMoverBarForm1"
ADD Object grdMyCity AS Grid With ;
Columncount = 2, ;
Height = 175, ;
Left = 225, ;
Recordsource = "MyCity", ;
Recordsourcetype = 1, ;
Top = 24, ;
Width = 250
ADD OBJECT lstList1 AS Listbox WITH ;
ColumnCount = 2, ;
ColumnWidths = "100,50", ;
RowSourceType = 0, ;
RowSource = "", ;
Height = 175, ;
Left = 30, ;
MoverBars = .T., ;
Top = 24, ;
Width = 175, ;
Name = "lstList1"
ADD OBJECT cmdCommand1 AS commandbutton WITH ;
Top = 216, ;
Left = 400, ;
Height = 29, ;
Width = 75, ;
Caption = "Exit", ;
Name = "CmdCommand1"
PROCEDURE lstList1.InteractiveChange
SELECT MyCity
FOR i = 1 TO ThisForm.lstList1.Listcount
LOCATE FOR city = ThisForm.lstList1.List(i)
REPLACE exp_2 WITH i
ThisForm.lstList1.List(i,2)=ALLTRIM(STR(i))
ENDFOR
GO TOP
ENDPROC
PROCEDURE lstList1.Init
SELECT city,exp_2 FROM MyCity INTO cursor x ORDER BY 2
i=0
SCAN
i=i+1
This.AddItem(city,i,1)
This.AddListItem(ALLTRIM(STR(exp_2)),i,2)
ENDSCAN
ENDPROC
PROCEDURE CmdCommand1.Click
SELECT MyCity
USE
ERASE mycity.dbf &&Comment this line in order to save the table.
CLEAR EVENTS
ENDPROC
ENDDEFINE
*
*-- EndDefine: moverbar
**************************************************
Additional query words: VFoxWin
Keywords: kbcode KB139958