Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使TabControl与其中的其他成员一起调整大小_C#_Wpf_Xaml_Tabcontrol_Tabitem - Fatal编程技术网

C# 如何使TabControl与其中的其他成员一起调整大小

C# 如何使TabControl与其中的其他成员一起调整大小,c#,wpf,xaml,tabcontrol,tabitem,C#,Wpf,Xaml,Tabcontrol,Tabitem,我知道TabControl不是一个可以自动调整大小的项目,您可以将它锚定到一侧,然后将其设置为拉伸,这可能会解决问题,但有没有其他方法可以让TabControl在应用程序最大化时扩展到全屏?同时,所有的属性也会扩展并保持比例。这可以在XAML中完成,而不是在XAML中创建所有内容时使用代码吗 Bellow是应用程序主窗口的代码片段,其中包含TabControl和5个TabItem中的一个,以及它包含的所有其他wpf属性。我正在努力使整个应用程序最大化时,有什么建议吗 XAML: 分行名称: 产

我知道TabControl不是一个可以自动调整大小的项目,您可以将它锚定到一侧,然后将其设置为拉伸,这可能会解决问题,但有没有其他方法可以让TabControl在应用程序最大化时扩展到全屏?同时,所有的属性也会扩展并保持比例。这可以在XAML中完成,而不是在XAML中创建所有内容时使用代码吗

Bellow是应用程序主窗口的代码片段,其中包含TabControl和5个TabItem中的一个,以及它包含的所有其他wpf属性。我正在努力使整个应用程序最大化时,有什么建议吗

XAML:


分行名称:
产品:
产品:
选择分支:

您有固定的高度和宽度,不知道为什么它不调整大小

将边距从网格中去掉

将高度和宽度从选项卡控件中去掉

我不太清楚您的问题。当你最大化你的窗口时,你希望你的按钮和字段被放大/看起来更大吗?你给了TabControl一个固定的高度和宽度,不知道为什么它不调整大小?如此简单却令人头痛
<Window x:Class="qaTrackingDatabase.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="QA Tracking DB Update Tool" Height="700.963" Width="868.283" Icon="rm12icon.ico" VerticalAlignment="Top">
<Grid Margin="0,0,-8,3">
    <Grid.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFDFEDF7" Offset="0"/>
            <GradientStop Color="#FFDFECF7" Offset="1"/>
        </LinearGradientBrush>
    </Grid.Background>
    <TabControl  Name="myTabControl" Height="658" Width="858" Margin="0,10,0,0" SelectionChanged="TabControl_SelectionChanged" Background="#FFDFECF7" VerticalAlignment="Top">
        <TabItem x:Name="Branch" Header="Branch" Width="170" >
            <Grid HorizontalAlignment="Left">
                <RadioButton Name="Add" Content="Add" RenderTransformOrigin="0.488,0.454" Margin="25,28,618,548" Checked="Branch_RadioBtns_Checked"/>
                <RadioButton Name="Delete" Content="Delete" HorizontalAlignment="Left" Margin="25,99,0,0" VerticalAlignment="Top" Checked="Branch_RadioBtns_Checked" Height="49" Width="205"/>
                <TextBox Name="Add_Name_txtBox" IsEnabled="{Binding ElementName=Add, Path=IsChecked}" HorizontalAlignment="Left" Height="25" TextWrapping="Wrap" Text="Enter Name" VerticalAlignment="Top" Width="230" Margin="351,53,0,0" SpellCheck.IsEnabled="True" Background="White"/>
                <TextBlock TextDecorations="Underline" FontWeight="Bold" FontFamily="Levenim MT" Margin="250,57,509,336"> Branch Name:</TextBlock>
                <ComboBox Name="Dproduct_Combo" IsEnabled="{Binding ElementName=Delete, Path=IsChecked}" Text="Select" HorizontalAlignment="Left" Height="25" Margin="111,120,0,0" VerticalAlignment="Top" Width="119" IsReadOnly="True" SelectionChanged="Get_Dproduct_Branch"/>
                <TextBlock TextDecorations="Underline" FontWeight="Bold" FontFamily="Levenim MT" Margin="41,123,757,482"> Product:</TextBlock>
                <ComboBox Name="Aproduct_Combo" IsEnabled="{Binding ElementName=Add, Path=IsChecked}" Text="Select" HorizontalAlignment="Left" Height="25" Margin="111,53,0,0" VerticalAlignment="Top" Width="119"/>
                <TextBlock TextDecorations="Underline" FontWeight="Bold" FontFamily="Levenim MT" Margin="41,57,757,548"> Product:</TextBlock>
                <TextBlock TextDecorations="Underline" FontWeight="Bold" FontFamily="Levenim MT" Margin="250,123,509,478"> Select Branch:</TextBlock>
                <ComboBox Name="Dbranch_Combo" IsEnabled="{Binding ElementName=Delete, Path=IsChecked}" HorizontalAlignment="Left" Height="25" VerticalAlignment="Top" Width="119" IsReadOnly="True" Margin="351,119,0,0"/>
                <Button Content="Commit&#xD;&#xA;Changes" HorizontalAlignment="Left" VerticalAlignment="Top" Width="192" Margin="637,187,0,0" Height="49" FontFamily="Levenim MT" FontWeight="Bold" FontSize="16" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Click="Branch_Commit_Changes"/>
            </Grid>
        </TabItem>