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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:16:31+00:00 2026-06-07T16:16:31+00:00

I have a WPF window that contains three items controls, along with 3 buttons.

  • 0

I have a WPF window that contains three items controls, along with 3 buttons. Is there any way using PrintVisual() that I can print just two of the items controls, and no buttons?

My first thought was to dynamically create a StackPanel and add the controls that I wanted to print to it, but I can’t do that without detaching them first and it seems problematic.

I would like to use PrintVisual because it’s so simple. (Unfortunately I can’t spend too much time on this application).

***Please forgive the lack of source code supplied, but I’m relatively new to WPF and currently my form is grotesquely over-coded. I guess I’m just curious if there is a simple solution out there.

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-06-07T16:16:32+00:00Added an answer on June 7, 2026 at 4:16 pm

    If your concern is only printing a part of the page. Place your two items controls that you want to print inside a Grid element. Give it a name

    <Grid x:Name="printGrid">
        ....
    </Grid>
    

    Then you can call PrintDialog.PrintVisual like

    PrintDialog printDialog = new PrintDialog();
    printDialog.PrintVisual(printGrid,"The Description");
    

    If you cannot manage to group only those controls into their own grid you could do it manually by creating a Container in code and adding your existing named itemsControls to them. Then you can PrintVisual the container.

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

Sidebar

Related Questions

I have a RichTextBox on a WPF window that I am using kind of
I have a WPF window that contains a DataGrid at the bottom half of
I have a grid in a WPF window, and that contains a label in
I have a WPF / XAML Window that contains a ComboBox that is giving
I have a WPF dll that contains a number of Window classes and exposes
I have a WPF Window that contains a TextBox. I have implemented a Command
I have a WPF Window that contains a UserControl with a MinWidth and MinHeight.
I have two images on a WPF window that are on top of each
At the moment I have a DocumentViewer in a WPF window that displays an
I develop on VS2010 WPF on Window 7. I have a project that does

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.