2 Replies - 1915 Views - Last Post: 11 March 2010 - 03:51 AM Rate Topic: -----

#1 Davor Bursac   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-February 10

winform print problem

Posted 10 March 2010 - 09:31 AM

Hy,
I am having a problem with printing a simple form. Every time i debug i get a blank paper out of printer.
Dunno why. I used printDialog and printDocument from toolbox on my form. I do however get a possibility to select printer and page range before the printing itself.
My code is:
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult r = printDialog1.ShowDialog();

            if (r == DialogResult.OK)

                printDocument1.Print(); 
        
        }



Is This A Good Question/Topic? 0
  • +

Replies To: winform print problem

#2 danny_kay1710   User is offline

  • D.I.C Regular
  • member icon

Reputation: 29
  • View blog
  • Posts: 359
  • Joined: 27-April 08

Re: winform print problem

Posted 10 March 2010 - 09:37 AM

Why have you created two threads for the same problem?

You haven't told it to print anything. You have from what I can tell dropped a PrintDocument onto your form and expected it to print something.

You cannot just print a form using that method.

Try these links to give you an idea of how the PrintDocument works:

http://msdn.microsof...ntdocument.aspx

http://msdn.microsof...529(VS.71).aspx

Hope that helps

This post has been edited by danny_kay1710: 10 March 2010 - 09:37 AM

Was This Post Helpful? 1
  • +
  • -

#3 Davor Bursac   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-February 10

Re: winform print problem

Posted 11 March 2010 - 03:51 AM

View Postdanny_kay1710, on 10 March 2010 - 08:37 AM, said:

Why have you created two threads for the same problem?

You haven't told it to print anything. You have from what I can tell dropped a PrintDocument onto your form and expected it to print something.

You cannot just print a form using that method.

Try these links to give you an idea of how the PrintDocument works:

http://msdn.microsof...ntdocument.aspx

http://msdn.microsof...529(VS.71).aspx

Hope that helps


it helped. works fine now. thx a lot danny. :bananaman:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1