USE cname oSel = CREATEOBJECT("MySelect") && Create a selection object oForm = CREATEOBJECT("myForm") oForm.Visible = .T. READ EVENTS * Tidy up code goes here * ... DEFINE CLASS myForm AS Form ADD OBJECT oButt1 AS Commandbutton oButt1.Caption="Select" oButt1.Top = 5 oButt1.Left = 5 FUNCTION oButt1.Click oSel.Visible = .T. ENDFUNC ADD OBJECT oButt2 AS Commandbutton oButt2.Caption="Exit" oButt2.Top = 35 oButt2.Left = 5 FUNCTION oButt2.Click ThisForm.Release ENDFUNC FUNCTION Destroy CLEAR EVENTS ENDFUNC ENDDEFINE DEFINE CLASS mySelect AS Form ShowWindow = 1 && 0=In Screen, 1=In Top-Level Form, 2=As Top-Level Form WindowType = 0 && 0=Modeless, 1=Modal AlwaysOnTop = .T. Height = 60 Width = 220 Caption = "Select Data Folder" MaxButton = .F. MinButton = .F. OldSel = '' ADD OBJECT myListbox AS Listbox WITH ; Left = 0,; Top = 0,; Height = 60,; Width = 220,; ColumnCount = 3,; ColumnWidths = '70,64,52',; FirstElement = 1,; NumberOfElements = 0,; RowSource = 'cname,cextra,iid',; RowSourceType = 6 FUNCTION myListbox.DblClick ThisForm.Visible=.F. ENDFUNC FUNCTION myListbox.KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode = 13 && Allow ENTER to terminate ThisForm.Visible=.F. ENDIF ENDFUNC FUNCTION Activate This.OldSel = SELECT() SELECT cname ENDFUNC FUNCTION Deactivate WAIT WINDOW cname+cextra+STR(iid) SELECT (This.OldSel) ENDFUNC ENDDEFINE