Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Interface and Graphics > Cancel button in Save Dialog box


Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2003, 08:23 PM
albertlse
Guest
 
Posts: n/a
Default Cancel button in Save Dialog box


I add a Save Dialog box in my form. whenever i call the save dialog box, and if I press the Cancel button, it will show error message. how can i handle this button?
Reply With Quote
  #2  
Old 03-05-2003, 09:55 PM
Machaira's Avatar
Machaira Machaira is offline
Jedi Coder

* Expert *
 
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
Default

Set the CancelError property to true and trap for the error cdlCancel.
Reply With Quote
  #3  
Old 03-05-2003, 10:27 PM
albertlse
Guest
 
Posts: n/a
Default

I'm newbie to VB. Can you show me the code
Reply With Quote
  #4  
Old 03-06-2003, 02:39 AM
BostjanK's Avatar
BostjanK BostjanK is offline
Junior Contributor
 
Join Date: Feb 2003
Location: Ljubljana, Slovenia
Posts: 324
Default

Code:
On Error resume Next
Dim s FileName As String

comDialog1.CancelError = True     
comDialog1.ShowSave

If Err = cdlCancel Then   
     sFileName = ""
Else                            
     sFileName = comDialog1.FileName
End If
Edit: Changed [php] tags
__________________
Slovenia - the green treasure of Europe

Last edited by Flyguy; 03-06-2003 at 03:57 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Someone Help Me With My Message Boxes Please!! Tajiri17 General 12 03-02-2002 11:29 AM
CommonDialog Save As- Save or Cancel? Bucky General 3 01-02-2002 08:55 PM
COMMON DIALOG - save, open, filetypes, etc... UseTheMan General 1 05-23-2001 11:08 AM
Inputbox and Cancel button victoria General 4 05-21-2001 07:15 PM
Error with Cancel button kingesk General 2 01-23-2001 05:54 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->