|
-
Aug 20th, 2008, 08:19 PM
#1
Thread Starter
Junior Member
[RESOLVED] [VB6] Exit Sub on CommonDialog Cancel
Hello everyone! I am using Microsoft Visual Basic 6. How do I exit the sub when the "Cancel" button is clicked in the CommonDialog? Thank you!
Last edited by Shadowz O Death; Aug 23rd, 2008 at 01:51 PM.
-
Aug 20th, 2008, 08:32 PM
#2
Re: Exit Sub on CommonDialog Cancel
Code doc(a member's username with a black bear as the avatar) has some code for using common dialog control. He had posted it in some of the previous threads. Search the forum for his code...
Good day, pal...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Aug 20th, 2008, 08:35 PM
#3
Re: Exit Sub on CommonDialog Cancel
You have to set CancelError to True:
Code:
Private Sub Command1_Click()
On Error GoTo ErrHandler
With CommonDialog1
.CancelError = True '<<< this is the key
.ShowOpen
'...
End With
Exit Sub
ErrHandler:
Err.Clear
Exit Sub
End Sub
-
Aug 20th, 2008, 09:23 PM
#4
Thread Starter
Junior Member
Re: Exit Sub on CommonDialog Cancel
 Originally Posted by RhinoBull
You have to set CancelError to True:
Code:
Private Sub Command1_Click()
On Error GoTo ErrHandler
With CommonDialog1
.CancelError = True '<<< this is the key
.ShowOpen
'...
End With
Exit Sub
ErrHandler:
Err.Clear
Exit Sub
End Sub
Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|