Printing the contents of a windows form ?

  • Thread starter Thread starter MrXs
  • Start date Start date
M

MrXs

first of all can i say hello to all members :D

i have made a very basic program with a few one line text boxes and a
few drop down boxes

i would like to print the data that is selected in these boxes, in the
same layout they appear on the form.

what is the easiest way to do this ?

also is there a easy way to save this layout and data to a txt file of
some kind for future printing / reading of the data ?

Thanks :)

MrXs
 
* (e-mail address removed)-spam.invalid (MrXs) scripsit:
i have made a very basic program with a few one line text boxes and a
few drop down boxes

i would like to print the data that is selected in these boxes, in the
same layout they appear on the form.

You could take a screenshot and then send this screenshot to the
printer:

<URL:http://www.google.com/[email protected]>

For printing, have a look at the 'PrintDocument' class and its
'PrintPage' event. Inside the 'PrintPage' event you can use
'e.Graphics.DrawImage' to draw the screenshot onto the printer.
also is there a easy way to save this layout and data to a txt file of
some kind for future printing / reading of the data ?

There are many ways to do that, but you will have to write the code for
loading the data and assigning it to the controls yourself.
 
Back
Top