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

  • Home
  • SEARCH
  • 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 8412517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:41:21+00:00 2026-06-10T00:41:21+00:00

I am trying to add dynamic tabs to my application. Right now if I

  • 0

I am trying to add dynamic tabs to my application. Right now if I click a button, it will open a new page. What I want is to open this page in a new tab. But when I set up the tab content to a page , the code complains. I wanna do something like this

private void bttnGoToClientsOnClick(object sender, RoutedEventArgs e)
{
    var content = new TextBlock();
    TabItem tab = new TabItem();
    tab.Header = "Search Page";
    SearchPage sp = new SearchPage();
    tab.Content = sp;
    tabControl.Items.Add(tab);
    this.NavigationService.Navigate(sp);
}

is there any way I can convert my page to usercontrol or cast it as user control

Thank you!

  • 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-10T00:41:22+00:00Added an answer on June 10, 2026 at 12:41 am

    But when I set up the tab content to a page , the code complains.

    It wouldn’t hurt if you were more specific here 🙂

    What is SearchPage class? It doesn’t seem to be the part of the WPF framework. I googled it up on the
    http://www.intersoftpt.com/ website. Is that it?

    TabItem.Content needs to be of ContentControl type, which SearchPage – apparently – is not. I’m sure you need to embed this SearchPage object in some control presenter, such as a panel, before you can assign it to TabItem.Content.


    Update:

    Try this, then:

    TabItem tab = new TabItem();
    tab.Header = "Search Page";
    SearchPage sp = new SearchPage();
    this.NavigationService.Navigate(sp);
    // ---------------------------------------------------- 
    var frame = new Frame(); // !
    frame.Navigate(sp);  // !
    tab.Content = frame; // !
    // ---------------------------------------------------- 
    tabControl.Items.Add(tab);
    

    While I believe this should work, I haven’t tested it. Please let me know if it doesn’t do the trick.

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

Sidebar

Related Questions

I'm trying to add the functionality to this dynamic order form that will auto
In this page there's a way to dynamic add html (textbox,input button and radio
Is there any way to create a dynamic Pinterest button? I'm trying to add
So, I'm trying to make a dynamic UI, and i want to add a
Trying to add dynamic borders on my website top, left, and right sides... The
I'm trying to add dynamic content to my mvc application. I'm using Steven Sanderson
I am trying to add some basic dynamic functionality to a web page. How
Trying to add a dynamic class value to one of my columns in CGridView:
I'm trying to add details to a database by using ajax and table dynamic
Im new to asp.net mvc. I'm trying add new model class but it got

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.