Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement