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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:03:50+00:00 2026-05-12T12:03:50+00:00

I have a UserControl that I want to add at runtime to my current

  • 0

I have a UserControl that I want to add at runtime to my current WPF Page. Is this possible?

Having a Menu-bar and under it i want to have all my information, i.e. that i select Menu -> Show Orders then I want the OrderList-UserControl to be added under the Menu.

Sure I could use an Order WPF Page for that but then I’d have to re-create the Menu everywhere? And I don’t like the redundancy in that.

I tried something like this which didn’t display anything at all, it sure did run the code inside the UserControl but nothing is displayed on my window:

wrapPanel1.Children.Add(new OrderControl(100));

Suggestions?

  • 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-12T12:03:50+00:00Added an answer on May 12, 2026 at 12:03 pm

    If you put a ContentPresenter as a placeholder you can set the Content property of that control to a control generated in codebehind.


    Strange, looking at the code in this link what you are doing should work correctly – and the code I gave you definitely works in my app – so I guess there is something wrong either with your custom control or the screen redraws. Can you add the control directly in XMAL and see it? What happens if you add the control through code behind then force a screen redraw (cover the window with another and then uncover it).

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

Sidebar

Related Questions

I have an UserControl that contains a Button : <UserControl> <Button> </UserControl> I want
I have a UserControl with a Border element within it that I want to
I have a usercontrol that I want to use as a ListBoxItem. <ListBox.ItemTemplate> <DataTemplate>
I have a custom UserControl that I created as a navigation menu that parses
I have a WPF UserControl that I'd like to inject dependencies into. What's the
I have a FlowLayoutPanel and want to add series of UserControl to it: mainPanel.Controls.Add(fx);
I have usercontrol in my page loaded using Page.Controls.Add(ctrl) Now, I have button in
I have a Panel I want to fill with some UserControl(s) at runtime. These
I have a UserControl, which contains another UserControl with Button. I want to add
I have a UserControl (XAML below) that has a ListBox that I want to

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.