File save dialog

  • Thread starter Thread starter thomasp
  • Start date Start date
T

thomasp

How do I determine if the user clicked the cancel button in a VB2005
filesavedialog? I have read some newsgroup messages that stated that it
would return a 0 length string but this is not the case. It returns the
value of the .filename property of the file save dialog.

Thanks,

Thomas
 
Thomas,

For VS2003:

Dim sfd As New SaveFileDialog

If sfd.ShowDialog() = DialogResult.OK Then
MsgBox(sfd.FileName)
Else
MsgBox("Cancelled")
End If

Kerry Moorman
 
How do I determine if the user clicked the cancel button in a VB2005
filesavedialog? I have read some newsgroup messages that stated that it
would return a 0 length string but this is not the case.

\\\
If OpenFileDialog1.ShowDialog() = DialogResult.Cancel Then
...
Else
...
End If
///
 
Back
Top