Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function similar to VFP getfile()
Message
 
To
17/04/2003 16:47:47
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00778692
Message ID:
00779120
Views:
22
See

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchEssentialCodeForWindowsFormsDialogBoxes.asp?frame=true


>Thanks Roman
>
>just curious, do you still have to do teh same thing in VB.NET
>
>Mo
>
>>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
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform