by Alberto Tarozzo (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 9th July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Display the Open dialog box. For this example create a form called Form1 whit one Command Button called 'CmdOpen' and one Common dialog
Dim FileSelect
cdbOpenFile.CancelError = True
On Error GoTo errHandler
cdbOpenFile.Filter = "Text Files (*.txt)|*.txt| " & _
"Doc Files (*.doc)|*.doc| " & _
"All Files (*.*)|*.*| "
'Specify default file name to open
cdbOpenFile.FileName = ""
' Specify default filter to *.txt
cdbOpenFile.FilterIndex = 1
' Display the Open dialog box, and
' save the selected file in the
' variable FileSelect
cdbOpenFile.ShowOpen
FileSelect = cdbOpenFile.FileName
errHandler:
'User pressed the Cancel button
End Function
Private Sub CmdOpen_Click()
openfile
End Sub
No comments have been posted about Display the Open dialog box. For this example create a form called Form1 whit one Command Button ca. Why not be the first to post a comment about Display the Open dialog box. For this example create a form called Form1 whit one Command Button ca.