Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

Member 10627757

@Member 10627757
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Print if checkbox ticked?
    M Member 10627757

    I am trying to print a questionnaire which has 6 check-boxes. I am following a tutorial but this tutorial does not have check-boxes. Below prints except for the check-box. The text in the checkbox prints but prints if checked or not. I need some kind of statement to print if checked but cant find any examples of doing so.

    private void metroButton3_Click(object sender, EventArgs e)
    {
    DSprintPreviewDialog.Document = DSprintDocument;
    DSprintPreviewDialog.ShowDialog();
    }

    private void DSprintDocument\_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
        Bitmap bmp = Properties.Resources.dslogo;
        Image newImage = bmp;
       // e.Graphics.DrawImage(newImage, 25,25, newImage.Width, newImage,Height);
        e.Graphics.DrawString("Customer Name: " + metroTextBox2.Text, new Font("Arial", 16, FontStyle.Regular), Brushes.Black, new Point(25, 180));
        e.Graphics.DrawString("Date: " + DateTime.Now, new Font("Arial", 12), Brushes.Black, new Point(25, 100));
        e.Graphics.DrawString("Computer Make: " + metroMakeBox28.Text, new Font("Arial", 14, FontStyle.Regular), Brushes.Black, new Point(25, 250));
        e.Graphics.DrawString("Customer Items: " + metroCheckBox1.Text, new Font("Arial", 14, FontStyle.Regular), Brushes.Black, new Point(25, 320));
    

    I've changed the following but it prints with a True or False

    e.Graphics.DrawString("Customer Items: " + metroCheckBox1.Checked + metroCheckBox1.Text, new Font("Arial", 14, FontStyle.Regular), Brushes.Black, new Point(25, 320));

    C# graphics sales tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups