General information
Category:
Forms & Form designer
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only