By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,198 Members | 954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,198 IT Pros & Developers. It's quick & easy.

File save dialog

P: n/a

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

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Thomas,

For VS2003:

Dim sfd As New SaveFileDialog

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

Kerry Moorman
"th*****@msala.net" wrote:

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

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

Nov 21 '05 #2

P: n/a
<th*****@msala.net> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a

Thanks, just what I needed.

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.