MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.32k stars 2.45k forks source link

How to increase the spacing between Tab Items? #2074

Closed feinstein closed 9 years ago

feinstein commented 9 years ago

Well, I guess the title says it all but...

I have a TabControl with several TabItems, but the Header of the TabItems are too close to each other. Is it there a way to increase their spacing? I tried Margin but this separates the Underline too.

Right now I am making it as Header=" Text ", it works but it's a hack.

punker76 commented 9 years ago

@feinstein you can change the Padding instead the Margin

feinstein commented 9 years ago

Have you tried it? Padding doesn't make a difference for me, if it does for you, please let me know so I can see what's wrong with my system.

Malavos commented 9 years ago

@feinstein Please post your Window Xaml code! :pray:

feinstein commented 9 years ago

It's quite big...the tab part it's just:

<mahapps:MetroTabItem mahapps:ControlsHelper.HeaderFontSize="{StaticResource TabFontSize}"                                  
                      Header="  My Header Text  " >                
</mahapps:MetroTabItem>

And my Tab Control is:

<mahapps:MetroTabControl mahapps:TabControlHelper.IsUnderlined="True" >
    <TabControl.Resources>
        <clr:Double x:Key="TabFontSize">18</clr:Double>                        
    </TabControl.Resources>

My general Resources.xaml file has nothing on tabs, and the rest of the Window xaml is just menu items and WindowCommands

Malavos commented 9 years ago

@feinstein Don't you have any other window property that's interfering with the tab disposition? Like responsive windows/etc?

punker76 commented 9 years ago

@feinstein it's a bug with the MetroTabItem, i'll fix this now

feinstein commented 9 years ago

Thanks! Em 26/08/2015 16:31, "Jan Karger" notifications@github.com escreveu:

@feinstein https://github.com/feinstein it's a bug with the MetroTabItem, i'll fix this now

— Reply to this email directly or view it on GitHub https://github.com/MahApps/MahApps.Metro/issues/2074#issuecomment-135147081 .

feinstein commented 9 years ago

@punker76 Why should I use a MetroTabItem instead of a TabItem? What do I get from it? Same question for MetroTabControl.

I can't find any documentations on it.

punker76 commented 9 years ago

@feinstein the difference is that you can have a close button with CloseButtonEnabled="True"

feinstein commented 9 years ago

@punker76 and what about MetroTabControl?

punker76 commented 9 years ago

@feinstein

punker76 commented 9 years ago

@feinstein @Malavos the Padding issue with the MetroTabItem should be fixed with b67193def4b8d57b5aa8362d920bf37ab54e27ea (latest alpha 154)

feinstein commented 9 years ago

@punker76 Great! Last question:

Can I make the MetroTabControl expand the tabs evenly to take all the available size?

For example:

Demo Screen

feinstein commented 9 years ago

@punker76 do you have any expected release date to have a Nuget Package for this release?

Malavos commented 9 years ago

@feinstein alpha 154.. https://www.nuget.org/packages/MahApps.Metro/1.1.3-ALPHA154

punker76 commented 9 years ago

@feinstein you can try create your own TabPanel and override the MeasureOverride and ArrangeOverride methods to fill the entire space.

feinstein commented 9 years ago

@Malavos I meant a proper release, I don't like to use Alphas and Betas....but thank you for the link!

Malavos commented 9 years ago

@feinstein oh yes, sorry about that.

punker76 commented 9 years ago

@feinstein sorry No due date yet

gepbird commented 4 years ago

How can I achive the same result in a WinForms application?

timunie commented 4 years ago

Hi @gutyina70 , MahApps is WPF only, so we do not support WinForms. Thank you for your understanding. Maybe this link helps you: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.integration.elementhost?redirectedfrom=MSDN&view=netframework-4.8

Happy coding, Tim