Google News
logo
WPF - Interview Questions
What is the Tab Control in WPF?
The Tab control is a common UI element that has been around for some time. It makes a convenient way to organize your window when there is more than could realistically fit and still be comprehensible. Tab Control is easier in Windows Presentation Foundation.
 
Two elements play main roles in building a tab control :
 
* TabControl and
* TabItem

TabControl is the container of one or more TabItem elements like as follows.
<TabControl>
   <TabItem Header="Tab 1">xyz</TabItem>
   <TabItem Header="Tab 2">abc</TabItem>
</TabControl>
In WPF, Tabs are very easy to implement. Create a new WPF Window, remove the default Grid tags, and add the following XAML:
<TabControl>
   <TabItem Header="Tab 1">xyz</TabItem>
   <TabItem Header="Tab 2">abc</TabItem>
</TabControl>
Advertisement