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 7016907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:50:46+00:00 2026-05-27T22:50:46+00:00

My silverlight application has a usercontrol (called CertificatePrintControl ) that is used to display

  • 0

My silverlight application has a usercontrol (called CertificatePrintControl) that is used to display and print some information.
I would like, inside another control, to istantiate the printCtl and print the content at runtime.
The example is:

foreach (var certId in CertToPrint)
    {
        var certPrintController = new CertificatePrintControl() { PrintDocument = pd, CertGuid = certId };
        certPrintController.Print();
        certPrintController = null;
    }

The problem is that inside the CertificatePrintControl there’s this code

    void pd_PrintPage(object sender, PrintPageEventArgs e)
    {
        try
        {
            var oldW = lstMainPrintCertificate.Width;
            var oldH = lstMainPrintCertificate.Height;
            lstMainPrintCertificate.Width = e.PrintableArea.Width;
            lstMainPrintCertificate.Height = e.PrintableArea.Height;
            e.PageVisual = lstMainPrintCertificate;
            lstMainPrintCertificate.Width = oldW;
            lstMainPrintCertificate.Height = oldH;
        }
        catch (Exception ex)
        { 
            //
        }
    }

that gives

 {System.InvalidOperationException: Element is already the child of another element.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
   at System.Windows.Printing.PrintPageEventArgs.set_PageVisual(UIElement value)
   at com.breathesaftey.Control.CertificatePrintControl.pd_PrintPage(Object sender, PrintPageEventArgs e)}

I may have understood why but I can’t find a workaround.

Thanks

  • 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-27T22:50:47+00:00Added an answer on May 27, 2026 at 10:50 pm

    I found this Silverlight reporting

    and I resolved the issue…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing Silverlight application where Page.xaml has some buttons on it that
I have a Silverlight application that has a DataGrid. I need to print the
I'm working on an in-browser Silverlight application that has some fairly compute-intensive operations, e.g.,
I have a Silverlight application which has on it a Canvas. On that Canvas,
I have a Silverlight 4 out-of-browser application with a ScrollViewer that has several RichTextBoxes
I have a Silverlight application in which I would like to call a WCF
I'm working on a Silverlight 3 application that has to communicate with a PHP
I have a mvvm(model view viewmodel) silverlight application that has several views that need
I have a Silverlight application that has a DataGrid and a DataPager. The data
I have a Silverlight application that has three regions that will host the same

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.