Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3332452
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:41:23+00:00 2026-05-17T23:41:23+00:00

Hy! I want to add a checkbox to a paragraph. My code: PrintDialog pd

  • 0

Hy!

I want to add a checkbox to a paragraph.

My code:

        PrintDialog pd = new PrintDialog();
        pd.ShowDialog();
        FlowDocument doc = new FlowDocument();
        Paragraph ph = new Paragraph();
        ph.Inlines.Add(new Bold(new Run("TODO\n")));
        foreach (CheckBox cb in box.Items)
        {
            int value = Convert.ToInt32("0x6F", 16);
            string stringValue = Char.ConvertFromUtf32(value);
            CheckBox bt = new CheckBox();
            bt.IsChecked = false;
            ph.Inlines.Add(new Run(bt + " "+cb.Content.ToString()));
        }
        doc.Name = "FlowDoc";
        doc.Blocks.Add(ph);
        IDocumentPaginatorSource idpSource = doc;
        pd.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing."); 

the output is wrong:

TODO System.Windows.Controls.CheckBox Content: IsChecked:False hahaSystem.Windows.Controls.CheckBox Content: IsChecked:False haha1System.Windows.Controls.CheckBox Content: IsChecked:False hallo

Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:41:23+00:00Added an answer on May 17, 2026 at 11:41 pm

    You could use BlockUIContainer http://msdn.microsoft.com/en-us/library/system.windows.documents.blockuicontainer.aspx

    PrintDialog pd = new PrintDialog();
    pd.ShowDialog();
    FlowDocument doc = new FlowDocument();
    Paragraph ph = new Paragraph();
    StackPanel sp = new StackPanel();
    BlockUIContainer buc = new BlockUIContainer(sp);
    ph.Inlines.Add(new Bold(new Run("TODO\n")));
    
    foreach (CheckBox cb in box.Items)
    {
        int value = Convert.ToInt32("0x6F", 16);
        string stringValue = Char.ConvertFromUtf32(value);
        CheckBox bt = new CheckBox();
        bt.IsChecked = false;
        bt.Content = cb.Content;
        //ph.Inlines.Add(new Run(bt + " " + cb.Content.ToString()));
        sp.Children.Add(bt);
     }
    
            doc.Name = "FlowDoc";
            doc.Blocks.Add(ph);
            doc.Blocks.Add(buc);
     IDocumentPaginatorSource idpSource = doc;
     pd.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing."); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change a outline view , and add checkbox cell in front
I want to add a checkbox in a alert panel . But now I
How can i add Checkbox in listbox. i want to make it in asp.net
I want to add checked option to checkbox if it has an id or
i have a drupal site with many users. I want to add newsletter checkbox
I want to add a class to my label of my checkbox if it's
Please help. I want to add a click event on checkbox that i created
Hi i want to add check box in datagrid view.i have writen test code
this.Controls.Add(new CheckBox{ Checked = true; }) When I add this in the page_load .
I want to add a checkbox to my registration field for terms&use. How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.