Member Avatar for denonth

How can i send Printdocument to richtextbox so i can write something above text and send it as email.

here is code:

private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                PrintDocument pd = new PrintDocument();
                pd.PrintPage += new PrintPageEventHandler(this.PrintPageEventHandler);
               
                if (this.storedPageSettings != null)
                    pd.DefaultPageSettings = this.storedPageSettings;
                PrintPreviewDialog dlg = new PrintPreviewDialog();
                
                dlg.Document = pd;
                dlg.Width=800;
                dlg.Height = 800;

                dlg.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

any help is appreciated

Use, instead "Window.Print()" Method. Hope it helps u. Sorry, it will work only for the Web Application. And if ur application is an web app then use it in onclick event of any button. It will work.

Member Avatar for denonth

Use, instead "Window.Print()" Method. Hope it helps u. Sorry, it will work only for the Web Application. And if ur application is an web app then use it in onclick event of any button. It will work.

I am using windows application. Problem is that I don't know if that is really a convertable type..you know from printdocument to string or stringbuilder

So I would really need help...That is the last thing in my project to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.