Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function similar to VFP getfile()
Message
De
17/04/2003 00:07:20
 
 
À
16/04/2003 22:06:24
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00778692
Message ID:
00778709
Vues:
22
There is a control called CommonDialog, you need to drop it on the form and then you can do something like this:

Dim strFilename As String
' Set CancelError is True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Set flags
CommonDialog1.Flags = cdlOFNHideReadOnly
' Set filters
CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files" & _
"(*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' Specify default filter
CommonDialog1.FilterIndex = 2
' Display the Open dialog box
CommonDialog1.ShowOpen
strFilename = CommonDialog1.FileName
Exit Sub

ErrHandler:
'User pressed the Cancel button
End Sub

Roman

>Hello
>
>in VB6, is there a function similar to VFP Getfile() function.
>
>Basicly, I want the user to select a file and capture the file name and path.
>
>Thanks
Roman Rehak, MCSD, MCDBA, MCSA
Competitive Computing
354 Mountain View Drive
Colchester, VT 05446-5824
802-764-1729
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform