Wrox Programmer Forums
|
BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8
This is the forum to discuss the Wrox book Visual Basic 2008 Programmer's Reference by Rod Stephens; ISBN: 9780470182628
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2009, 06:21 PM
Registered User
 
Join Date: Dec 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another real beginner question

I have been working with VB2008 for a few days now. I can’t get my program to print on anything but the default printer.
I select another printer in PrintDialog1.ShowDialog but the printing comes out on the default printer. How do I make use of the selected printer?
My code is:
Code:
       Try
            'Specify current page settings
            PrintDocument1.DefaultPageSettings = PrintPageSettings
            'Specify document for print dialog box and show
            StringToPrint = RichTextBox1.Text
            PrintDialog1.Document = PrintDocument1
            Dim result As DialogResult = PrintDialog1.ShowDialog()
            'If click OK, print document to printer
            If result = DialogResult.OK Then
                PrintDocument1.Print()
            End If
        Catch ex As Exception
            'Display error message
            MessageBox.Show(ex.Message)
        End Try





Similar Threads
Thread Thread Starter Forum Replies Last Post
Real beginner question G222 Visual Studio 2008 2 December 26th, 2009 01:19 PM
a question from a beginner starnold BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 June 18th, 2009 10:36 AM
Question for the real tech lords. Warbird General .NET 2 November 10th, 2005 09:51 PM
Beginner Question dkr72 Excel VBA 1 January 18th, 2005 09:37 AM
PHP real question jimmychuck BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 September 14th, 2004 11:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.