title: How to Print with Margins
body: <p>I am making a Wordpad program. I am making this feature in which you click this button, and it prints to your default printer. I have done some research, and I found some functional code that prints to my printer:</p>
  
  <pre><code>private void buttonPrint_Click(object sender, EventArgs e)
      {
          string print = "" + textBody.Text;
  
          PrintDocument p = new PrintDocument();
          p.PrintPage += delegate(object sender1, PrintPageEventArgs e1)
          {
              e1.Graphics.DrawString(print, new Font("Times New Roman", 12), new     SolidBrush(Color.Black), new RectangleF(0, 0, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
          };
          try
          {
              p.Print();
          }
          catch (Exception ex)
          {
              throw new Exception("Exception Occured While Printing", ex);
          }
      }
  </code></pre>
  
  <p>This works currently, but I was wondering if I could make it WITH margins, which it does not have now. All it does is this:</p>
  
  <pre><code>&lt;Top of Page&gt;
  &lt;Message&gt;
  </code></pre>
  
  <p>There are no margins on the top, sides (left,right), and bottom.  How can I modify my code to have margins?</p>