Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do I remove the small white space around grid in a tab control?

$
0
0

I've got an application I want to put a grid TabControl onto, and within that a grid. I've found that there's a small white space between the TabControl and the grid itself. I tried getting rid of that by setting the grid's horizontal and vertical alignment to stretch, but that didn't help. So, I've simplified my problem by writing up a simple WPF app, which illustrates my problem. Here's the XAM:

<Window x:Class="TestTabControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        mc:Ignorable="d"
        Title="Test the TabControl" d:DesignHeight="600" d:DesignWidth="700"><Window.Resources><Style TargetType="{x:Type TabItem}"><Setter Property="Margin" Value="0" /></Style></Window.Resources><Grid><TabControl BorderThickness="0" Margin="0"><TabItem Header="Tab 1"><Grid Background="BlanchedAlmond" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"><Grid.RowDefinitions><RowDefinition Height="Auto" /><RowDefinition Height="*" /></Grid.RowDefinitions><TextBlock Text="Some stuff" HorizontalAlignment="Center" FontSize="15" /></Grid></TabItem><TabItem Header="Tab 2"></TabItem></TabControl></Grid></Window>

How do I get rid of that small, white space around the inner grid within the tab control?

Rod


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>