We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Need to center text in the tab (TabControlExt)

Thread ID:





150907 Jan 23,2020 11:36 PM UTC Jan 27,2020 01:51 PM UTC WPF 3
Tags: TabControlExt
Mike Allred
Asked On January 23, 2020 11:36 PM UTC

My image automatically centers, but my text is left aligned. How do I center the text? It seems that center should be the default anyway . . .

What am I missing here?

My code:

        <syncfusion:TabControlExt Name="tabMain" Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" Grid.ColumnSpan="2" TabStripPlacement="Top"
                                  TabScrollStyle="Extended" TabScrollButtonVisibility="Visible"
                                  syncfusion:SkinStorage.VisualStyle="Transparent" >
            <syncfusion:TabItemExt Name="pgtPartMaster" Header="Part Master" HorizontalContentAlignment="Center" HorizontalAlignment="Center"
                                   Width="150" Height="70" HeaderMargin="0,5,0,0"
                                   Image="Images/PartMaster.png" ImageAlignment="AboveText" ImageHeight="30" ImageWidth="30" IconMargin="0,10,0,0" >
                <Grid />

Kanniyappan Panneer Selvam [Syncfusion]
Replied On January 24, 2020 11:34 AM UTC

Hi Mike, 
Thanks for contacting the Syncfusion support. 
We checked your query “Need to center the header text in the tab item” and we have prepared the sample to meet your requirements by overriding the tab item style template. Please find the sample and screenshot for the same. 
Please let us know if you have any further assistance. 
Kanniyappan P 

Mike Allred
Replied On January 24, 2020 05:26 PM UTC

Thanks for the example. Do you have an example that uses WPF and .NET Core 3.0?

When I copy your code in I get these messages:

On the line:

I'm told:
 Undefined CLR namespace. the clr-namespace URI refers to a namespace 'System'  that could not be found

On the 2nd line here:
        <Style TargetType="{x:Type syncfusion:TabItemExt}" BasedOn="{StaticResource TransparentTabItemExtStyle}">

I'm told:
 The recource "TransparentTabItemExtStyle" could not be resolved.

There are many more like this 2nd one.

I've tried installing the Syncfusion.Themes.Office2010Blue.WPF NuGet package. I also have Syncfusion.Share.WPF and Syncfusion.Tools.WPF installed.

Niranjan Kumar Gopalan [Syncfusion]
Replied On January 27, 2020 01:51 PM UTC

Hi Mike , 

Thanks for your patience. 

We have created the requested sample in WPF .Core project and please add the below code in App.xaml. Please refer the attached sample for same. 

                <ResourceDictionary Source="/Syncfusion.Tools.WPF;component/Controls/TabControlExt/Themes/TransparentStyle.xaml"/> 

Niranjan Kumar 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon