List of Drives Combobox – VFP

We can show easily List of Drives within Combobox here is sample…

Local oForm As Form
oForm = Createobject(‘TestForm’)
oForm.Show(1)
Return

Define Class TestForm As Form
AutoCenter = .T.

Add Object cboDrives As ComboBox With ;
Left = 100, Top = 100, Style = 2
Procedure cboDrives.Init
Local lnDrive, lcDrive
For lnDrive = Asc(‘A’) To Asc(‘Z’)
lcDrive = Chr(m.lnDrive)
If Drivetype(m.lcDrive) > 1
This.AddItem(m.lcDrive)
Endif
Next
Endproc
Enddefine

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s