Articles in this section
Category / Section

How to set image in Tabitem Header for TabcontrolExt?

Image can be displayed in TabItemExt Header by Image Property of TabcontrolExt.

The same has been explained in the following code snippet:

XAML:

//Code Explains How to set image in Tabitem header for TabcontrolExt
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="TabcontrolTxt1.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<syncfusion:TabControlExt Name="Tabcontrol"  >
<syncfusion:TabItemExt Name="tab1" Header="Tab1" Width="150" Image="Syncfusion.png" ImageWidth="25" ImageHeight="20">
</syncfusion:TabItemExt>
<syncfusion:TabItemExt Header="Tab2"  Image="Syncfusion.png"
 ImageWidth="25" ImageHeight="20">
</syncfusion:TabItemExt>
<syncfusion:TabItemExt Header="Tab3" ></syncfusion:TabItemExt>
<syncfusion:TabItemExt Header="Tab4" ></syncfusion:TabItemExt>
 </syncfusion:TabControlExt>
</Grid>
</Window>
 

C#:

//Code Explains How to set image in Tabitem header for TabcontrolExt
namespace TabcontrolTxt1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri("/Syncfusion.png", UriKind.Relative);
bi3.EndInit();
tabitem1.Image = bi3;
  }
  }
  }

 

Output:

 

C:\Users\Ashok.Murugesan\Desktop\KBTask\13.4SprintKBTools\ScreenShot\image.png

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied