Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 14th, 2011, 05:38 AM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Angry Ch 34, Printing

Hello.
Can someone help.
Ch.34 Printing sample: Src\ch34\printbooklet
Everything works fine, but PrintDialog (dlgPrint) will not print.

Thanks
Alex
Reply With Quote
  #2 (permalink)  
Old May 14th, 2011, 11:37 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi Alex,

I don't understand what you're saying. Do you mean it displays the dialog but when you click the dialog's Print button it doesn't print?
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #3 (permalink)  
Old May 14th, 2011, 04:09 PM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rod.
Thank you for your quick answer.

the answer is YES.

On Src\Ch34 is 2 samples: printSimple and printBooklet.
on both samples there is 3 options:Print now,Print Preview & Print Dialog
If you press Print on Print now & Print Preview at will print
on Print Dialog at will show the Dialog, but if you press Print at will not Print

Regards
Alex
Reply With Quote
  #4 (permalink)  
Old May 14th, 2011, 05:09 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

The only thing I can think of is that you need to set the dialog's Document property to a PrintDocument. You won't be able to tell if you haven't because that dialog doesn't display a preview (unlike the PrintPreview dialog).

Let me know if that's the problem and if that's in the book's original code (I'm not at the right computer right now) and I'll post a note on the book's web site.

If that isn't it, then I have to suspect something wrong with the control. (Hopefully I just forgot to set the Dialog property.)
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #5 (permalink)  
Old May 15th, 2011, 04:27 AM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi Rod.

I am running the book's original code samples and my own code with Win7,VB 2010 and HP5610 printer.
all the same. printDialog will not fire (will not print).
As "direct print" or print previaw" will print with no problems and the code is the same code, I agree with you that is noting wrong with code, the problen
is with the control.
The tool property: "Document" show "(None)" and can not be changed.


to make the story short, I found in the MSDN a way to over come the problem.
Remove the line " dlgPrint.ShowDialog()" from the samples
and add the following:
If dlgPrint.ShowDialoge(Me)=Windows.Forms.DialogResul t.OK Then
m_PrintDocument.Print()
End If

Best Regards & enjoy your weekend.
Alex

N.B: I would like to thank you for the outstanding book which is a bible for me in VB 2010.
Reply With Quote
  #6 (permalink)  
Old May 15th, 2011, 08:45 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

That sounds familiar. Thanks for posting in case others need this.

Quote:
N.B: I would like to thank you for the outstanding book which is a bible for me in VB 2010.
I'm glad you're finding it useful. Post a review!
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page 34 - Projects flapjack BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 3rd, 2010 07:50 AM
Page 34-41 of the book curiaquita BOOK: Professional C++ 0 December 29th, 2009 11:42 AM
Ch 7, p234-239: Printing a Document mk goody BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 July 17th, 2007 09:30 PM



All times are GMT -4. The time now is 06:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.