Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How can I use print handler to pring a file?

Reply
Thread Tools

How can I use print handler to pring a file?

 
 
Allen
Guest
Posts: n/a
 
      10-03-2009
How can I use print handler to pring a file?

--------------------------------------------------------------------------------

Hi everybody,

I need your help.

The code below came from a book which teaches how to print a sketch. The
book did not show how to print a file. Right now if I run this program (as
is)it will show the printer dialog box. If I click OK (to print), the
printer will print an empty paper. How can I use this code to print a file
("ReadMe.txt")?

I would apprciate it if you could help.



private: System::Void printToolStripMenuItem_Click(System::Object ^ sender,
System::EventArgs ^ e)
{
// The PrintDocument holds the settings
PrintDocument^ pdoc = gcnew PrintDocument();

// Create a dialog and attach it to the document
PrintDialog^ pd = gcnew PrintDialog();

pd->Document = pdoc;

// Show the dialog
if (pd->ShowDialog() == System::Windows::Forms:ialogResult::OK)

{
// Add the page handler

pdoc->PrintPage += gcnew PrintPageEventHandler(this,&Form1:rintAPage);
// Print the page
pdoc->Print();

}
else
MessageBox::Show("Print cancelled", "Information");
}

void PrintAPage(Object^ pSender, PrintPageEventArgs^ pe)
{




}


--
Thanks
Allen

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      10-03-2009
Wrong group ? Try
http://msdn.microsoft.com/en-us/libr...ent.print.aspx.

A Windows programming group would be better suited (this one is for web
applications).

--
Patrice

 
Reply With Quote
 
 
 
 
Allen
Guest
Posts: n/a
 
      10-03-2009
Hi Patrice,
Can you give me an address for a Windows programming group?

--
Thanks
Allen
"Patrice" <http://scribe-en.blogspot.com/> wrote in message
news:(E-Mail Removed)...
> Wrong group ? Try
> http://msdn.microsoft.com/en-us/libr...ent.print.aspx.
>
> A Windows programming group would be better suited (this one is for web
> applications).
>
> --
> Patrice


 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      10-04-2009
> Can you give me an address for a Windows programming group?

I would try a group such as :

microsoft.public.dotnet.framework.windowsforms.

Also the link I provided earlier shows how to print a file assuming each
line is small enought to fit on a single line. It uses C# but it should be
easy to convert to C++/CLI.

--
Patrice

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Is there a way to pring a list object in Python? Zeynel Python 7 11-09-2010 03:17 AM
Event Handler that creates adds another event handler kaczmar2@gmail.com ASP .Net 1 02-22-2007 07:37 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Pring array into a text file avashisht Perl 5 02-21-2004 06:51 AM



Advertisments