Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
QuestionPrint if checkbox ticked? Pin
Member 1062775714-Oct-16 10:45
Member 1062775714-Oct-16 10:45 
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.


C#
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

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

AnswerRe: Print if checkbox ticked? Pin
NotPolitcallyCorrect14-Oct-16 11:39
NotPolitcallyCorrect14-Oct-16 11:39 
AnswerRe: Print if checkbox ticked? Pin
Midi_Mick14-Oct-16 14:09
professionalMidi_Mick14-Oct-16 14:09 
AnswerRe: Print if checkbox ticked? Pin
omeecode17-Oct-16 18:46
omeecode17-Oct-16 18:46 
QuestionPolymorphism Pin
Vanichandrik Suptajesacar13-Oct-16 17:00
Vanichandrik Suptajesacar13-Oct-16 17:00 
AnswerRe: Polymorphism Pin
OriginalGriff13-Oct-16 19:07
mveOriginalGriff13-Oct-16 19:07 
GeneralRe: Polymorphism Pin
Peter_in_278013-Oct-16 19:37
professionalPeter_in_278013-Oct-16 19:37 
GeneralRe: Polymorphism Pin
OriginalGriff13-Oct-16 19:44
mveOriginalGriff13-Oct-16 19:44 
AnswerRe: Polymorphism Pin
Nathan Minier14-Oct-16 1:56
professionalNathan Minier14-Oct-16 1:56 
QuestionHow to integrate Facebook marketing API in window application using c# Pin
Member 1063574713-Oct-16 3:11
Member 1063574713-Oct-16 3:11 
AnswerRe: How to integrate Facebook marketing API in window application using c# Pin
Eddy Vluggen13-Oct-16 3:38
professionalEddy Vluggen13-Oct-16 3:38 
QuestionHTMLtoPDF Downloader Pin
Member 1279065812-Oct-16 18:29
Member 1279065812-Oct-16 18:29 
AnswerRe: HTMLtoPDF Downloader Pin
Member 1279065812-Oct-16 18:41
Member 1279065812-Oct-16 18:41 
AnswerRe: HTMLtoPDF Downloader Pin
Nathan Minier13-Oct-16 3:13
professionalNathan Minier13-Oct-16 3:13 
AnswerRe: HTMLtoPDF Downloader Pin
yellow flower18-Oct-16 1:39
yellow flower18-Oct-16 1:39 
QuestionC# Stopwatch - DateTime And Timer Tick - Is there a better way to run the Stopwatch Pin
Member 1275660312-Oct-16 12:05
Member 1275660312-Oct-16 12:05 
AnswerRe: C# Stopwatch - DateTime And Timer Tick - Is there a better way to run the Stopwatch Pin
Midi_Mick12-Oct-16 19:05
professionalMidi_Mick12-Oct-16 19:05 
AnswerRe: C# Stopwatch - DateTime And Timer Tick - Is there a better way to run the Stopwatch Pin
OriginalGriff12-Oct-16 22:47
mveOriginalGriff12-Oct-16 22:47 
AnswerRe: C# Stopwatch - DateTime And Timer Tick - Is there a better way to run the Stopwatch Pin
Bernhard Hiller13-Oct-16 22:08
Bernhard Hiller13-Oct-16 22:08 
AnswerRe: C# Stopwatch - DateTime And Timer Tick - Is there a better way to run the Stopwatch Pin
omeecode15-Oct-16 8:56
omeecode15-Oct-16 8:56 
QuestionHTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
Atul Shriram rane11-Oct-16 17:57
Atul Shriram rane11-Oct-16 17:57 
AnswerRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
NotPolitcallyCorrect12-Oct-16 4:53
NotPolitcallyCorrect12-Oct-16 4:53 
GeneralRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
Pete O'Hanlon12-Oct-16 4:59
mvePete O'Hanlon12-Oct-16 4:59 
GeneralRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
NotPolitcallyCorrect12-Oct-16 5:47
NotPolitcallyCorrect12-Oct-16 5:47 
QuestionI have a search button and datagrid in c# and SQL Pin
antonio_dsanchez11-Oct-16 11:16
antonio_dsanchez11-Oct-16 11:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.