Click here to Skip to main content
16,004,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


i have searched on google about the "tab" for my web application.

but i m not getting the satisfectory answer. there is no control for tab component.

please tell me how can i create tab in my web page so that i can open different page on each tab.


thanks.....

i would appriciate if you can provide me a small example in C#
Posted

1 solution

In your main panel, you can keep adding a .NET TabItem to get "tab" effect in your web application. Here is the sample code:


C#
private void btnTabSimuate_Click(object sender, RoutedEventArgs e)
{
    mainHostPanel.Items.Add(CreateTabWeb());
}

private TabItem CreateTabWeb()
{
    TabItem tabItem = new TabItem();
    tabItem.Header = "Header On Tab";
    tabItem.Content = new DoView();
    tabItem.Tag = "Tag";
    tabItem.MinWidth = 90;
    tabItem.BorderThickness = new Thickness(0);
    tabItem.Style = Application.Current.Resources["MyStyle"] as Style;
    return tabItem;
}
 
Share this answer
 
Comments
Tushar1999 5-Mar-12 6:31am    
do i have to insert any component on web page from the toolbox ???...

Actually i could not understand that ....
private void btnTabSimuate_Click(object sender, RoutedEventArgs e)

from where this CLICK_EVENT has come from.....
Tushar1999 5-Mar-12 21:57pm    
i m still waiting for reply from your side....
:(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900