Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 February 17th, 2004, 05:29 PM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing Hell (richTextBox)

OK I created all the code for printing the textboxes, lines, labels as I wanted in my form. I can't use me.printform because the format and text in the RichTextBox is poor. Therefore I use something like below.

NOW I have a very weird thing happening, Part of the code is below.

    Printer.CurrentY = 360
    Printer.CurrentX = 8640
    Printer.Print FormBonCommande.TextCodeCollege

    Printer.CurrentY = 360
    Printer.CurrentX = 9480
    Printer.Print FormBonCommande.TextNumeroCollege

    Printer.CurrentY = 2640
    Printer.CurrentX = 240
    Printer.Print ""
    RichTextBoxEcole.SelPrint Printer.hDC

Why does the Rich Text Box always print on the very first line of the page all the time. No matter what the currentX, CurrentY is. It seems that the code is always ignored.

Any help?

 
Old February 17th, 2004, 05:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try

  RichTextBoxEcole.SelPrint Printer.hDC, False
  ...
  Printer.EndDoc

Marco
 
Old February 17th, 2004, 05:51 PM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately Even by Adding False at the End gets me the same kind of result

The Text of the RichTBox is still printed on the very first line of the page.

 
Old February 17th, 2004, 09:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please refer to the first sentence in the MSDN article Q146022
"The SelPrint method of the RichTextBox control does not allow a programmer to set the position of the output on the printer"
The same article shows the workaround
Marco
 
Old February 18th, 2004, 10:20 AM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Marco I don't know how to thank you. This is exactly what I wanted. I must add though, that I must include all my code in the one found to make everything fit together.

Thanks a lot again.

Mark






Similar Threads
Thread Thread Starter Forum Replies Last Post
What Is dll Hell ? Bhalchandra VB Components 2 December 18th, 2006 03:23 PM
DLL Hell huanglanjing Access VBA 2 December 7th, 2006 11:13 AM
AutoNumber Hell somissac Access VBA 5 March 22nd, 2005 04:05 AM
Circular Reference Hell! RFickling C# 1 November 7th, 2004 06:38 PM
ereg and eregi Hell! TreeWalker BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 21st, 2003 11:19 PM





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