Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DriveListBox in VFP
Message
From
20/02/2006 12:32:49
 
 
To
20/02/2006 07:54:14
Somesh Sahu
Cybage Software Pvt Ltd,
Pune, India
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Miscellaneous
Thread ID:
01097489
Message ID:
01097555
Views:
14
Can controls like DriveListBox and DirListBox (standard controls of VB) be used on a form in VFP?
Or else how can such functionlities can be given on the form in VFP?


Here is a wrapper around VFP's native GETDIR() function - should do what you want:
**************************************************
*-- Class:        cntgetdir 
*-- ParentClass:  container
*-- wrapper for vfp GetDir() function
*
DEFINE CLASS cntgetdir AS CONTAINER

  WIDTH = 403
  HEIGHT = 35
  BACKSTYLE = 0
  BORDERWIDTH = 0
  *-- Specifies the directory that is initially displayed in the dialog box. When cDirectory is not specified, the dialog box opens with the Visual FoxPro default directory displayed.
  cdirectory = ""
  *-- Specifies the text for the directory list in the Open dialog box. In Windows 95, the text appears below the list of files and long text strings may be truncated.
  ctext = ""
  *-- Holds the value returned by the GetDir function
  cpath = ""
  NAME = "cntgetdir"


  ADD OBJECT label1 AS lblbase WITH ;
    AUTOSIZE = .T., ;
    BACKSTYLE = 0, ;
    CAPTION = "Directory:", ;
    HEIGHT = 17, ;
    LEFT = 8, ;
    TOP = 8, ;
    WIDTH = 53, ;
    NAME = "Label1"


  ADD OBJECT txtdirectory AS txtbase WITH ;
    HEIGHT = 22, ;
    LEFT = 72, ;
    TOP = 4, ;
    WIDTH = 288, ;
    NAME = "txtDirectory"


  ADD OBJECT cmdgetdir AS cmdbase WITH ;
    TOP = 4, ;
    LEFT = 370, ;
    HEIGHT = 22, ;
    WIDTH = 22, ;
    FONTBOLD = .T., ;
    CAPTION = ". . .", ;
    NAME = "cmdGetDir"


  *-- Issue a GetDir() and populate the textbox with its results
  PROCEDURE GETDIR
  *** Invoke the VFP native GetDir function with the container's properties
  *** These properties correspond to all of the paramters accepted by the GetFile function
  WITH THIS
    .cpath = GETDIR( .cdirectory, .ctext )
    .txtdirectory.VALUE = .cpath
  ENDWITH

  ENDPROC


  PROCEDURE INIT
  WITH THIS
    .txtdirectory.VALUE = .cpath
  ENDWITH
  ENDPROC


  PROCEDURE cmdgetdir.onclick
  THIS.PARENT.GETDIR()
  ENDPROC


ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform