Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox to list the drives/folders of my computer
Message
From
30/10/2000 18:03:23
Bill Drew
Independent Consultant
Chicago, Illinois, United States
 
 
To
29/10/2000 21:28:52
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00435790
Message ID:
00436143
Views:
20
>Can anybody tell me how to make a combo box which list out the local drives in my computer, whcih I can select from it for folder selection.
>
>Thank you for kind attention.
I use a routine that finds removable drives and puts them in an option group. You might be able to adapt it for a combo box and for all types of drives. Or you might want to use getdir().

local nowno,i,curtop
nowon=1
curtop = 8
for i = 65 to 92
if inlist(drivetype(chr(i)),2)
decl thisform.drives(nowon,2)
thisform.drives(nowon,1) = chr(i)
thisform.drives(nowon,2) = "Drive "+chr(i)
thisname = "opbutton"+allt(str(nowon))
thisform.optiongroup1.addobject(thisname,"optionbutton")
thisform.optiongroup1.&thisname..caption = "Drive "+chr(i)
thisform.optiongroup1.&thisname..width = 100
thisform.optiongroup1.&thisname..top = curtop
thisform.optiongroup1.&thisname..visible = .t.
thisform.optiongroup1.&thisname..left = 10
curtop = curtop + 21
if nowon > 1
thisform.optiongroup1.height = thisform.optiongroup1.height+21
endi
nowon = nowon + 1
if nowon = 5
exit
endi
endi

endf
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform