473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Printing model in VB.NET doesn't match my needs

I have a VB6 app that I'm converting. At various places in the program it
might be writing to a Textbox and also prints the text. Or someplace else,
it may ask the user something and depending on the reply print something.
I.e., the printing is dispersed among the logic of the program.

All the printing samples I've looked at have the printing code collected in
one place. I don't know how I can do that. I need to open a document, print
from wherever and when finished close the document.

Can I do that somehow?
Cal
Nov 20 '05 #1
3 1055
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
I have a VB6 app that I'm converting. At various places in the program it
might be writing to a Textbox and also prints the text. Or someplace else,
it may ask the user something and depending on the reply print something.
I.e., the printing is dispersed among the logic of the program.

All the printing samples I've looked at have the printing code collected in
one place. I don't know how I can do that. I need to open a document, print
from wherever and when finished close the document.


Why not "collect" everything you want to print in an appropriate
datastructure and then print everything at once?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
> Why not "collect" everything you want to print in an appropriate
datastructure and then print everything at once?

I guess I could do that. For each print command I'd have to save the font,
position on the page and text. There are also some lines drawn. As I think
about it ,it seems doable. The big drawback is that I would accommodate only
a subset of the things a graphics object could do. Be nice if I could come
up with a general approach

What about a bitmap with the same resolution as the printer. Think that
would work? Except now the page would get downloaded as graphics. I expect
Windows sends text to the printer but maybe it always print by sending
graphics. Do you know?

I know very little about Metafiles. I wonder if that would be worth
investigating. If a metafile is full of text does it get sent to a printer
as text or graphics?

I was hoping someone would tell me about a class that could be used for
printing much as the VB6 printer object was. No such luck so far but I'm
still hoping

Any constructive suggestions of what direction to study and/or which will
probably not be fruitful at all will be appreciated,
Cal

Nov 20 '05 #3
> Why not "collect" everything you want to print in an appropriate
datastructure and then print everything at once?

I guess I could do that. For each print command I'd have to save the font,
position on the page and text. There are also some lines drawn. As I think
about it ,it seems doable. The big drawback is that I would accommodate only
a subset of the things a graphics object could do. Be nice if I could come
up with a general approach

What about a bitmap with the same resolution as the printer. Think that
would work? Except now the page would get downloaded as graphics. I expect
Windows sends text to the printer but maybe it always print by sending
graphics. Do you know?

I know very little about Metafiles. I wonder if that would be worth
investigating. If a metafile is full of text does it get sent to a printer
as text or graphics?

I was hoping someone would tell me about a class that could be used for
printing much as the VB6 printer object was. No such luck so far but I'm
still hoping

Any constructive suggestions of what direction to study and/or which will
probably not be fruitful at all will be appreciated,
Cal

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: | last post by:
Hey there, I want to print some dots in a single-line while my program loads or does something. I tried with he following but it didn't work :(. while 1: print '.', Prints line of dots...
8
by: deko | last post by:
I'm hoping someone can sanity check my understanding of the Object Model for Forms/Controls. I'm having trouble drilling down into Control properties. First, I have a record set with the...
4
by: Salad | last post by:
I'm developing an app where the print output will be on a dot-matrix printer. I suppose the printers will either be an Epson or Okidata, not really sure at this point. I, unfortunately, do not...
5
by: Erik | last post by:
I'm using an ActiveX control to display a Gantt chart in my Access 2003 application. It's all setup and programmed and displays nicely. The control supports printing, but its documentation is...
57
by: Robert Seacord | last post by:
i am trying to print the address of a function without getting a compiler warning (i am compiling with gcc with alot of flags). if i try this: printf("%p", f); i get: warning: format %p...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
2
by: Marc Gravell | last post by:
It appears that when using the component model (or the default implementation, at least), then any duplicated attributes (e.g. from properties) are dropped. In my test, component-model outputs...
8
by: Frank Rizzo | last post by:
I am trying to print huge images (much bigger than target paper). I try and use e.PageSettings.HardMarginX and e.PageSettings.HardMarginY in the PrintDocument's PrintPage event to try and...
0
by: Deceneu | last post by:
Hi everyone, this is my first post so please bear with me. I have the following situation: i have a local report that needs to have two "versions": one for viewing in the report viewer (with all...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.