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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:37:46+00:00 2026-05-20T06:37:46+00:00

I have 3 tab items to implement. When the program executes, I would like

  • 0

I have 3 tab items to implement. When the program executes, I would like user to only be able to see tab1 and hide tab 2 and tab 3.

something like this happens when the program execute:

public Window1()
{   
    InitializeComponent();

    // I need tabs 2 and 3 to be hidden   
}

Then I have a button in tab 1. When users click this, tab 2 shows up but still hide tab 3

private void Button1_Click(object sender, RoutedEventArgs e)
{
    tabcontrol1.SelectedIndex = 1;
    //need some code to show tab 2
}

And I have a button in tab 2 to show tab 3 and then all the tabs are visible

private void Button2_Click(object sender, RoutedEventArgs e)
{
    tabcontrol1.SelectedIndex = 2;
    // need some code to show tab 3    
}

My XAML code:

<TabControl Name="Tabcontrol1" Margin=" 5" SelectedIndex="0">
    <TabItem Header="Directories">
        <Grid Width="1185" Height="945" Background="White" >
            <Label Height="28" HorizontalAlignment="Right" 
                    Margin="0,0,25,0" Name="label11" VerticalAlignment="Top"  
                    Width="120">Step 1 of 2</Label>
        </Grid>
    </TabItem>
    <TabItem Header="Properties" Opacity="1" Name="Properties">
        <Grid Width="1185" Height="945" Background="White" >
            <Button Height="32" Name="Button1" VerticalAlignment="Bottom" 
                    HorizontalAlignment="Right" Width="82" Click="Button1_Click" 
                    Margin="0,0,41,49">Build</Button>
        </Grid>
    </TabItem>
    <TabItem Header ="Output">
        <Grid Width="1185" Height="945" Background="White">
            <Button Height="32" Name="Button2" VerticalAlignment="Bottom" 
                    HorizontalAlignment="Right" Width="82" Click="Button2_Click" 
                    Margin="0,0,41,49">Build</Button>
        </Grid>
     </TabItem>
</TabControl>

I am quite confused because i can only select a tab using:

tabcontrol1.SelectedIndex = 1;

I was thinking along the line of implementing

tabcontrol1.SelectedIndex.Visibility = Hidden;

please advice 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-20T06:37:47+00:00Added an answer on May 20, 2026 at 6:37 am

    Set Visibility of 2nd and 3rd tab to Collapsed initially. And also give them a name to be able to access them in code behind.

    <TabItem Name="TabItem2" Header="Properties" Opacity="1" Name="Properties" Visibility="Collapsed">
    ...
    <TabItem Name="TabItem3" Header ="Output" Visibility="Collapsed">
    ...
    

    And change your button click code to the following:

    private void Button1_Click(object sender, RoutedEventArgs e)
    {
        tabcontrol1.SelectedIndex = 1;
        //need some code to show tab 2
        TabItem2.Visibility = Visibility.Visible;
    }
    
    private void Button2_Click(object sender, RoutedEventArgs e)
    {
        tabcontrol1.SelectedIndex = 2;
        // need some code to show tab 3 
        TabItem3.Visibility = Visibility.Visible;   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab navigator control and I would like to make all of
I have idea to implement my wpf windows like TabPages in tab control. It
I have 2 tab items. In tab No.1 I have a control which corresponds
I have a Tab Control with multiple Tab Pages. I want to be able
I would like a simple description of how to implement a virtualizingstackpanel for an
I have a tab page that should be hidden if a property (BlahType) is
I have a tab delimited file where each record has a timestamp field in
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
So I have a form with lots of controls that all have a tab
I have a huge tab separated file which I want to sort on its

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.