[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

patrick

11/29/2004 2:03:00 AM

Hi Ng,

I have a panel which I want to print with the printDocument object. How can
it be done?

Thanks in advance and best regards,
Patrick Braunschweig
3 Answers

Robby

11/29/2004 11:57:00 AM

0


You could use a PrintDocument object. Use its PrintPage event and write to
its Graphics object from the Panel's Graphics object. Use the Panel's
CreateGraphics object to get its Graphics object.

--Robby

"Patrick" <Patrick@discussions.microsoft.com> wrote in message
news:4CB6ABB5-2CCB-4C8B-8E80-3C5987558029@microsoft.com...
> Hi Ng,
>
> I have a panel which I want to print with the printDocument object. How
> can
> it be done?
>
> Thanks in advance and best regards,
> Patrick Braunschweig


patrick

11/30/2004 4:39:00 AM

0

but what and how should I write to the printDocument Graphics object?

"Robby" schrieb:

>
> You could use a PrintDocument object. Use its PrintPage event and write to
> its Graphics object from the Panel's Graphics object. Use the Panel's
> CreateGraphics object to get its Graphics object.
>
> --Robby
>
> "Patrick" <Patrick@discussions.microsoft.com> wrote in message
> news:4CB6ABB5-2CCB-4C8B-8E80-3C5987558029@microsoft.com...
> > Hi Ng,
> >
> > I have a panel which I want to print with the printDocument object. How
> > can
> > it be done?
> >
> > Thanks in advance and best regards,
> > Patrick Braunschweig
>
>
>

Robby

11/30/2004 7:17:00 AM

0


This took some looking into by searching the VS.Net documentation (you can
also use MSDN.com). I had an idea of how I would do it manually; do a
screen capture of the Panel, paste it somewhere and print it. As it turns
out this is more or less what you have to do in your code.

The following link does this for an entire form. Just change the Graphics
object of the form to the Panel and it should work.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbCode/html/vbtskCodeExamplePrintPreviewi...

--Robby


"Patrick" <Patrick@discussions.microsoft.com> wrote in message
news:2BA57C81-96DC-4AA8-9875-6A82A00365B8@microsoft.com...
> but what and how should I write to the printDocument Graphics object?
>
> "Robby" schrieb:
>
>>
>> You could use a PrintDocument object. Use its PrintPage event and write
>> to
>> its Graphics object from the Panel's Graphics object. Use the Panel's
>> CreateGraphics object to get its Graphics object.
>>
>> --Robby
>>
>> "Patrick" <Patrick@discussions.microsoft.com> wrote in message
>> news:4CB6ABB5-2CCB-4C8B-8E80-3C5987558029@microsoft.com...
>> > Hi Ng,
>> >
>> > I have a panel which I want to print with the printDocument object. How
>> > can
>> > it be done?
>> >
>> > Thanks in advance and best regards,
>> > Patrick Braunschweig
>>
>>
>>