Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the spacing between Tab Items? #2074

Closed
feinstein opened this issue Aug 14, 2015 · 21 comments
Closed

How to increase the spacing between Tab Items? #2074

feinstein opened this issue Aug 14, 2015 · 21 comments
Milestone

Comments

@feinstein
Copy link
Contributor

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
Copy link
Member

@feinstein you can change the Padding instead the Margin

@feinstein
Copy link
Contributor Author

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
Copy link

Malavos commented Aug 26, 2015

@feinstein Please post your Window Xaml code! 🙏

@feinstein
Copy link
Contributor Author

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
Copy link

Malavos commented Aug 26, 2015

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

@punker76
Copy link
Member

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

@feinstein
Copy link
Contributor Author

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
#2074 (comment)
.

@feinstein
Copy link
Contributor Author

@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
Copy link
Member

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

@feinstein
Copy link
Contributor Author

@punker76 and what about MetroTabControl?

@punker76
Copy link
Member

@feinstein

  • it generates by default MetroTabControls if you bind a collection to ItemsSource
  • you can define a CloseTabCommand which will also execute if you close a MetroTabItem
  • you can define TabStripMargin for the tab item panel

@punker76
Copy link
Member

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

@feinstein
Copy link
Contributor Author

@punker76 Great! Last question:

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

For example:

Demo Screen

@feinstein
Copy link
Contributor Author

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

@Malavos
Copy link

Malavos commented Aug 26, 2015

@punker76
Copy link
Member

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

@feinstein
Copy link
Contributor Author

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

@Malavos
Copy link

Malavos commented Aug 26, 2015

@feinstein oh yes, sorry about that.

@punker76
Copy link
Member

@feinstein sorry No due date yet

@punker76 punker76 added this to the 1.2.0 milestone Aug 26, 2015
@gepbird
Copy link

gepbird commented Feb 4, 2020

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

@timunie
Copy link
Collaborator

timunie commented Feb 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants