Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

Re: Commondialog.showprinter



Tip: Looking for answers? Try searching our database.



You are accessing this site in a read-only mode. For full access to all member benefits, including message posting, please login or register. Registration is completely free, simple, and takes only a few seconds.

Login | Free VBMonster.com registration | Whole discussion thread

The message you are replying to and its parents are listed in the reverse order with the most recent posts first. This might not be the whole discussion thread. To read all the messages in this thread please click here.

Re: Commondialog.showprinter

Jeff Johnson17 Aug 2009 13:34
> Yes, it's stupid. It'd be MUCH better if the various Showxxx methods
> simply returned a Boolean with False meaning the user clicked Cancel. But
> the reason it is the way it is goes clear back to VB1 when the control
> didn't have those methods.  Instead, it had an Action property that you
> assigned a value to display a certain dialog box.

Hurray for backwards compatibility....

Barf.

MikeD14 Aug 2009 22:17
> Hi evereone,
>
[quoted text clipped - 7 lines]
> print
> out.

There is no "command". You have to set the CancelError property to True and
then trap for an error the control raises when the user clicks the Cancel
button.  Here's some example code:

-----BEGIN CODE SNIPPET
   On Error GoTo EH

   CommonDialog1.CancelError = True
   CommonDialog1.ShowPrinter

    <do your printing>

   Exit Sub

EH:

   Select Case Err.Number
       Case cdlCancel
           'User clicked Cancel button on Print dialog box
       Case Else
           MsgBox Err.Description
   End Select
-----END CODE SNIPPET

Yes, it's stupid. It'd be MUCH better if the various Showxxx methods simply
returned a Boolean with False meaning the user clicked Cancel. But the
reason it is the way it is goes clear back to VB1 when the control didn't
have those methods.  Instead, it had an Action property that you assigned a
value to display a certain dialog box.

This is one of many things that people find annoying about this particular
control. Because of the annoyances of the control, and it's rather limited
capability, most people use Win32API functions to show the common
dialogs...at least in production apps (they might use the control in demo
apps and the like).

Signature

Mike


Carlos Gonzalez14 Aug 2009 18:33
Hi evereone,

I would like to know what command I should use with the
COMMONDIALOG.SHOWPRINTER (ex.: Commondialog1.showprinter) to cancel the print
job.

My problem is that when I call the commondialog1.showprinter and I would
like to cancel the job, when I click "Cancel"; I am still getting the print
out.

I will would like to know what could be the command line to be used.

Thanks for your help

Carlos Gonzalez

Quick links:

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage




©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.