Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenFileDialog - Catch 'Cancel' button click 1

Status
Not open for further replies.

jbehrne

Programmer
Dec 18, 2002
484
US
Hi all,

I am using OpenFileDialog to allow the user to search for .txt files for upload. How do you handle the OpenFileDialog if the user selects cancel? Is there any specific code to handle this event? Thanks,

jbehrne

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 

try

Code:
        Dim f As SaveFileDialog

        If f.ShowDialog = DialogResult.Cancel Then

        End If
 
oops

i used a saveFileDialog in my example but it works just as well with an openFileDialog
 
Thanks - works perfect!

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top