Невозможно создать полосу прокрутки C# WPF - PullRequest
0 голосов
/ 24 февраля 2020

В настоящее время я пытаюсь вставить scrollBar в мое приложение C# (используя WPF ), даже если я использую объект scrollbar в WPF (scrollbar по-прежнему отключен (серым цветом))

<GroupBox Header="Setting" Margin="5,0,5,0" Grid.Row="1">
     <ScrollViewer HorizontalScrollBarVisibility="Auto" IsManipulationEnabled="True">

     <TabControl x:Name="tabSetting" Margin="5,0,5,0" >
     <TabItem x:Name="Tab_CmdSettings" Header="CMD settings">
     <Grid Name="grid_CMD_settings" ScrollViewer.CanContentScroll="True">
     <Grid.ColumnDefinitions>
          <ColumnDefinition Width="8*"/>
          <ColumnDefinition Width="10*"/>
     </Grid.ColumnDefinitions>
     <Label Content="A1A2 fall voltage (% Un_min)" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
     <TextBox x:Name="textBox_buff_dtr" Height="21" TextWrapping="Wrap" Text="nvm_dtr" HorizontalAlignment="Left" Margin="0,3,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
     <Label x:Name="label_Unmin" Content="Un_min= " HorizontalAlignment="Left" Margin="130,0,0,0" VerticalAlignment="Top" Grid.Column="1"/>
     <Label Content="A1A2 rise voltage (% Un_max)" HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Grid.Column="0"/>
...
...

ИЛИ

Я пытаюсь использовать Property

AutoScroll = "true"

в своей форме.

Но это не было распознано, и оно sh во время компиляции. Я думаю, что это Properties происходит от WinForm не WPF

<GroupBox Header="Protection Parameters" Grid.Row="0" Grid.ColumnSpan="2" AutoScroll="True">
    <Grid Name="grid_Protection" AutoScroll="True">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="84*"/>
        <ColumnDefinition Width="145*"/>
        <ColumnDefinition Width="287*"/>
    </Grid.ColumnDefinitions>

    <Label Content="Short circuit function selection" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="2"/>
    <RadioButton x:Name="radioButton_buff_enascc_On" GroupName="group_enascc" Content="Enable" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Grid.Column="2" IsChecked="True"/>
    <RadioButton x:Name="radioButton_buff_enascc_Off" GroupName="group_enascc" Content="Disable" HorizontalAlignment="Left" Margin="100,5,0,0" VerticalAlignment="Top" Grid.Column="2" />
    <Label Content="Short circuit current level (x Ir_max)" HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="2"/>
    <TextBox x:Name="textBox_buff_ie3scc" Height="21" TextWrapping="Wrap" Text="nvm_ie3scc" HorizontalAlignment="Left" Margin="0,23,0,0" VerticalAlignment="Top" Width="120" Grid.Column="2" />
</GroupBox>
...
</Grid>
...
</TabItem>
...
  • Кто-нибудь знает, что я делаю неправильно?

  • Не достаточно ли вставить полосу прокрутки или добавить AutoSize?

  • обязательно кодировать в C#?

Ответы [ 3 ]

1 голос
/ 24 февраля 2020

Из свойств WinForms сделать AutoScroll Свойство True.

Панель прокрутки будет отображаться только

  • , если Содержимое элементов Form больше фактического Form Control или

  • , если Form не соответствует разрешению экрана экрана.

0 голосов
/ 25 февраля 2020

@ Brainy_Clown Согласен, но ... я поместил весь графический объект в StackPanel, чтобы установить минимальный размер. когда я уменьшаю windows до минимума или максимума, полоса прокрутки все еще недоступна.

<Window x:Class="MPDE_Monitor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MPDE_Monitor"
        mc:Ignorable="d"
        Title="MPDE Monitor" Height="980" Width="600" Closing="Window_Closing" ResizeMode="CanResizeWithGrip" MinWidth="600" MinHeight="700">
    <Grid>
        <Menu IsMainMenu="True" VerticalAlignment="Top">
            <MenuItem Header="_File">
                <MenuItem x:Name="menu_connect" Header="_Connect" Click="connect_Click" />
                <MenuItem x:Name="menu_reloadini" Header="Reload INI file" Click="menu_reloadini_Click" />
                <TextBox Text="Factory mode" KeyDown="TextBox_KeyDown" PreviewMouseLeftButtonDown="TextBox_PreviewMouseLeftButtonDown"/>
                <Separator />
                <MenuItem x:Name="menu_exit" Header="_Exit" Click="menu_exit_Click" />
            </MenuItem>
            <MenuItem x:Name="menu_about" Header="_About" Click="menu_about_Click" />
        </Menu>
        <GroupBox x:Name="group1" Header="Connection settings" Margin="9,22,10,0" VerticalAlignment="Top" Height="71">
            <Grid Margin="2,0,-3,0">
                <RadioButton x:Name="radioUART" GroupName="com_port" Content="UART" HorizontalAlignment="Left" Margin="50,8,0,0" VerticalAlignment="Top" IsChecked="True" Checked="RadioButton_Checked"/>
                <RadioButton x:Name="radioSPI" GroupName="com_port" Content="SPI" HorizontalAlignment="Left" Margin="7,8,0,0" VerticalAlignment="Top" Checked="RadioButton_Checked"/>
                <Label Content="Port :" Margin="103,3,315,0" VerticalAlignment="Top"/>
                <ComboBox x:Name="Comm_port" HorizontalAlignment="Left" Margin="139,4,0,0" VerticalAlignment="Top" Width="60" DropDownOpened="Comm_port_DropDownOpened"/>
                <Button x:Name="connect" Content="Connect" HorizontalAlignment="Left" Margin="207,4,0,0" VerticalAlignment="Top" Width="70" Click="connect_Click"/>
                <Label x:Name="conn_status" Content="connection msg" Margin="282,0,69,0" VerticalAlignment="Top" Height="29"/>
...
                <Label Content="Factory mode:" Margin="7,23,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="91" RenderTransformOrigin="0.479,-0.25"/>
                <TextBox x:Name="password" Text="Password" KeyDown="TextBox_KeyDown" PreviewMouseLeftButtonDown="TextBox_PreviewMouseLeftButtonDown"  HorizontalAlignment="Left" Margin="102,28,0,0" VerticalAlignment="Top"></TextBox>
            </Grid>
        </GroupBox>

        <TabControl x:Name="tabControl" Margin="10,98,10,227">
 ...
            <TabItem x:Name="Tab_Conf_Setting" Header="Config and Settings">
                <Grid Name="grid_Monitor1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <GroupBox Header="Product" Margin="5,0,5,0" Grid.Row="0">
                        <Grid Name="grid_Product" >
                            <Label Content="Target product" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                            <ComboBox x:Name="comboBox_buff_tag" HorizontalAlignment="Left" Margin="125,3,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="ComboBox_SelectionChanged">
                                <ComboBoxItem Content="B0/B1 24V" IsSelected="True"/>
                                <ComboBoxItem Content="B0/B1 Wide range"/>
                            </ComboBox>
                            <Label Content="Ir range (A)" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top"/>
                            <ComboBox x:Name="comboBox_buff_range" HorizontalAlignment="Left" Margin="125,33,0,0" VerticalAlignment="Top" Width="120">
                                <ComboBoxItem Content="not_selected (default)" IsSelected="True"/>
                                <ComboBoxItem Content="[0.15A - 0.6A] (LUCxX6xx)"/>
...
                            </ComboBox>
                            <Label Content="A1A2 voltage (V)" HorizontalAlignment="Left" Margin="275,0,0,0" VerticalAlignment="Top"/>
                            <ComboBox x:Name="comboBox_buff_a1a2" HorizontalAlignment="Left" Margin="400,3,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="ComboBox_SelectionChanged">
                                <ComboBoxItem Content="not_selected (default)" IsSelected="True"/>
                                <ComboBoxItem Content="24Vdc (LUxxxxBL)"/>
...
                            </ComboBox>
                            <Label Content="Type of control unit" HorizontalAlignment="Left" Margin="275,30,0,0" VerticalAlignment="Top"/>
                            <ComboBox x:Name="comboBox_buff_uctype" HorizontalAlignment="Left" Margin="400,33,0,0" VerticalAlignment="Top" Width="120">
                                <ComboBoxItem Content="not_selected (default)" IsSelected="True"/>
                                <ComboBoxItem Content="B0 - Class 10 - 3 phases [LUCA]"/>
...
                            </ComboBox>
                            <Label Content="Diagnostic contactor (only B3)" HorizontalAlignment="Left" Margin="10,55,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                            <RadioButton x:Name="radioButton_buff_diag_On" GroupName="group_diag" Content="Enable" HorizontalAlignment="Left" Margin="185,62,0,0" VerticalAlignment="Top" IsChecked="True"/>
                            <RadioButton x:Name="radioButton_buff_diag_Off" GroupName="group_diag" Content="Disable" HorizontalAlignment="Left" Margin="300,62,0,0" VerticalAlignment="Top"  />
                        </Grid>
                    </GroupBox>
                    <GroupBox Header="Setting" Margin="5,0,5,0" Grid.Row="1">
                        <ScrollViewer HorizontalScrollBarVisibility="Auto" IsManipulationEnabled="True">
                            <StackPanel MinHeight="700" MinWidth="500">

                            <TabControl x:Name="tabSetting" Margin="5,0,5,0">
                                <TabItem x:Name="Tab_CmdSettings" Header="CMD settings">
                                    <Grid Name="grid_CMD_settings" ScrollViewer.CanContentScroll="True">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="8*"/>
                                            <ColumnDefinition Width="10*"/>
                                        </Grid.ColumnDefinitions>
                                        <Label Content="A1A2 fall voltage (% Un_min)" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                        <TextBox x:Name="textBox_buff_dtr" Height="21" TextWrapping="Wrap" Text="nvm_dtr" HorizontalAlignment="Left" Margin="0,3,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
...
                                    </Grid>
                                </TabItem>
                                <TabItem x:Name="Tab_PTR_Settings" Header="PRT settings" ScrollViewer.CanContentScroll="True">

                                    <Grid Name="grid_PTR_Settings" ScrollViewer.CanContentScroll="True">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="30*"/>
                                            <ColumnDefinition Width="481*"/>
                                        </Grid.ColumnDefinitions>

                                        <GroupBox Header="Protection Parameters" Grid.Row="0" Grid.ColumnSpan="2">
                                            <Grid Name="grid_Protection">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="8*"/>
                                                    <ColumnDefinition Width="10*"/>
                                                </Grid.ColumnDefinitions>
                                                <Label Content="Short circuit function selection" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_enascc_On" GroupName="group_enascc" Content="Enable" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_enascc_Off" GroupName="group_enascc" Content="Disable" HorizontalAlignment="Left" Margin="100,5,0,0" VerticalAlignment="Top" Grid.Column="1" />
                                                <Label Content="Short circuit current level (x Ir_max)" HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_ie3scc" Height="21" TextWrapping="Wrap" Text="nvm_ie3scc" HorizontalAlignment="Left" Margin="0,23,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
                                                <Label Content="Magnetic function selection" HorizontalAlignment="Left" Margin="0,40,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_enamgn_On" GroupName="group_enamgn" Content="Enable" HorizontalAlignment="Left" Margin="0,45,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_enamgn_Off" GroupName="group_enamgn" Content="Disable" HorizontalAlignment="Left" Margin="100,45,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                                <Label Content="Magnetic current level (x Ir)" HorizontalAlignment="Left" Margin="0,60,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_imgn" Height="21" TextWrapping="Wrap" Text="nvm_imgn" HorizontalAlignment="Left" Margin="0,63,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1"/>
                                                <Label Content="TRIP when magnetic fault (only B3)" HorizontalAlignment="Left" Margin="0,80,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_trpmgn_On" GroupName="group_trpmgn" Content="Enable" HorizontalAlignment="Left" Margin="0,85,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_trpmgn_Off" GroupName="group_trpmgn" Content="Disable" HorizontalAlignment="Left" Margin="100,85,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                                <Label Content="Overload function selection" HorizontalAlignment="Left" Margin="0,100,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_enaovl_On" GroupName="group_enaovl" Content="Enable" HorizontalAlignment="Left" Margin="0,105,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_enaovl_Off" GroupName="group_enaovl" Content="Disable" HorizontalAlignment="Left" Margin="100,105,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                                <Label Content="Protection class" HorizontalAlignment="Left" Margin="0,120,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <ComboBox x:Name="comboBox_buff_cls" HorizontalAlignment="Left" Margin="0,123,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1">
                                                    <ComboBoxItem Content="Class 5" IsSelected="True" />
                                                    <ComboBoxItem Content="Class 10"/>
                                                </ComboBox>
                                                <Label Content="Motor type" HorizontalAlignment="Left" Margin="0,140,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_mono_On" GroupName="group_mono" Content="Single phase" HorizontalAlignment="Left" Margin="0,145,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_mono_Off" GroupName="group_mono" Content="Three phase" HorizontalAlignment="Left" Margin="100,145,0,0" VerticalAlignment="Top" Grid.Column="1"/>

                                                <Label Content="Phase loss function selection" HorizontalAlignment="Left" Margin="0,160,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_enaloss_On" GroupName="group_enaloss" Content="Enable" HorizontalAlignment="Left" Margin="0,165,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_enaloss_Off" GroupName="group_enaloss" Content="Disable" HorizontalAlignment="Left" Margin="100,165,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                                <Label Content="Phase loss duration (ms)" HorizontalAlignment="Left" Margin="0,180,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_tloss" Height="21" TextWrapping="Wrap" Text="nvm_tloss" HorizontalAlignment="Left" Margin="0,183,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1"/>
                                                <Label Content="TRIP when phase loss fault (only B3)" HorizontalAlignment="Left" Margin="0,200,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_trploss_On" GroupName="group_trploss" Content="Enable" HorizontalAlignment="Left" Margin="0,205,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_trploss_Off" GroupName="group_trploss" Content="Disable" HorizontalAlignment="Left" Margin="100,205,0,0" VerticalAlignment="Top" Grid.Column="1"/>

                                                <Label Content="Ground fault function selection" HorizontalAlignment="Left" Margin="0,220,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_enagf_On" GroupName="group_enagf" Content="Enable" HorizontalAlignment="Left" Margin="0,225,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_enagf_Off" GroupName="group_enagf" Content="Disable" HorizontalAlignment="Left" Margin="100,225,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                                <Label Content="Ground fault level (x Ir)" HorizontalAlignment="Left" Margin="0,240,0,0" VerticalAlignment="Top" Grid.Column="0" />
                                                <TextBox x:Name="textBox_buff_ig2" Height="21" TextWrapping="Wrap" Text="nvm_ig2" HorizontalAlignment="Left" Margin="0,245,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1"/>
                                                <Label Content="Desensitization level (x Ir)" HorizontalAlignment="Left" Margin="0,260,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <ComboBox x:Name="comboBox_buff_idsz1" HorizontalAlignment="Left" Margin="0,263,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1">
                                                    <ComboBoxItem Content="18.0 (No desensitization !)" IsSelected="True"/>
                                                    <ComboBoxItem Content="3.0"/>
                                                </ComboBox>
                                                <Label Content="Desensitizated GF level (x Ir)" HorizontalAlignment="Left" Margin="0,280,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <ComboBox x:Name="comboBox_buff_igdsz1" HorizontalAlignment="Left" Margin="0,283,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1">
                                                    <ComboBoxItem Content="2.0" IsSelected="True"/>
                                                    <ComboBoxItem Content="3.0"/>
                                                </ComboBox>
                                                <Label Content="TRIP when ground fault (only B3)" HorizontalAlignment="Left" Margin="0,300,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_trpgf_On" GroupName="group_trpgf" Content="Enable" HorizontalAlignment="Left" Margin="0,305,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_trpgf_Off" GroupName="group_trpgf" Content="Disable" HorizontalAlignment="Left" Margin="100,305,0,0" VerticalAlignment="Top" Grid.Column="1"/>
                                            </Grid>
                                        </GroupBox>
                                        <GroupBox Header="Calibration" Grid.Row="1" Grid.ColumnSpan="2">
                                            <Grid Name="grid_Calibration">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="8*"/>
                                                    <ColumnDefinition Width="10*"/>
                                                </Grid.ColumnDefinitions>
                                                <Label Content="Calibration gain phase 1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_cal1" Height="21" TextWrapping="Wrap" Text="nvm_cal1" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
                                                <Label Content="Calibration gain phase 2" HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_cal2" Height="21" TextWrapping="Wrap" Text="nvm_cal2" HorizontalAlignment="Left" Margin="0,25,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
                                                <Label Content="Calibration gain phase 3" HorizontalAlignment="Left" Margin="0,40,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_cal3" Height="21" TextWrapping="Wrap" Text="nvm_cal3" HorizontalAlignment="Left" Margin="0,45,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
                                            </Grid>
                                        </GroupBox>
                                    </Grid>
                                </TabItem>
                                <TabItem x:Name="Tab_Safety_and_others_Settings" Header="Safety and Others settings">
                                    <Grid Name="grid_Tab_and_safety">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="346*"/>
                                            <ColumnDefinition Width="165*"/>
                                        </Grid.ColumnDefinitions>
                                        <GroupBox Header="Safety" Grid.Row="0" Grid.ColumnSpan="2">
                                            <Grid Name="grid_Safety">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="8*"/>
                                                    <ColumnDefinition Width="10*"/>
                                                </Grid.ColumnDefinitions>
                                                <Label Content="ETH pin detection" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <RadioButton x:Name="radioButton_buff_eth_On" GroupName="group_eth" Content="Enable" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True"/>
                                                <RadioButton x:Name="radioButton_buff_eth_Off" GroupName="group_eth" Content="Disable" HorizontalAlignment="Left" Margin="100,5,0,0" VerticalAlignment="Top" Grid.Column="1"/>
...
...
                                            </Grid>
                                        </GroupBox>
                                        <GroupBox Header="Wide range parameters" Grid.Row="1" Grid.ColumnSpan="2">
                                            <Grid Name="grid_wild_range">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="8*"/>
                                                    <ColumnDefinition Width="10*"/>
                                                </Grid.ColumnDefinitions>
                                                <Label Content="Inrush proportional coeff." HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                                <TextBox x:Name="textBox_buff_kp_iap" Height="23" TextWrapping="Wrap" Text="nvm_kp_iap" HorizontalAlignment="Left" Margin="0,3,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
...
                                            </Grid>
                                        </GroupBox>
                                    </Grid>
                                </TabItem>
                                <TabItem x:Name="Tab_Traceability" Header="Traceability">
                                    <Grid Name="grid_Traceability" Grid.ColumnSpan="4">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="8*"/>
                                            <ColumnDefinition Width="10*"/>
                                        </Grid.ColumnDefinitions>
                                        <Label Content="Production year (> 2020)" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                                        <TextBox x:Name="textBox_buff_year" Height="23" TextWrapping="Wrap" Text="nvm_year" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="120" Grid.Column="1" />
...
                                    </Grid>
                                </TabItem>
                            </TabControl>
                            </StackPanel>
                        </ScrollViewer>
                    </GroupBox>
                </Grid>
            </TabItem>
            <TabItem x:Name="TabMonitor" Header="Monitoring">
                <TabControl x:Name="tabControlmonitoring2" Margin="5,0,5,0">
  ...
                    <TabItem x:Name="Tab_Fault" Header="Fault Status">
                        <Grid Name="grid_Fault">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="8*"/>
                                <ColumnDefinition Width="10*"/>
                            </Grid.ColumnDefinitions>
                            <Label Content="Short circuit fault" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0"/>
                            <RadioButton x:Name="radioButton_fltscc_On" GroupName="group_fltscc" Content="Enable" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Grid.Column="1" IsChecked="True" IsEnabled="False"/>
                            <RadioButton x:Name="radioButton_fltscc_Off" GroupName="group_fltscc" Content="Disable" HorizontalAlignment="Left" Margin="100,5,0,0" VerticalAlignment="Top" Grid.Column="1" IsEnabled="False"/>
...
                        </Grid>
                    </TabItem>
...
                    <TabItem x:Name="Tab_Diag" Header="Diagnostic Status">
                        <Grid Name="grid_Diag">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="8*"/>
                                <ColumnDefinition Width="10*"/>
                            </Grid.ColumnDefinitions>
                            <Label Content="Initial IDIAG current (mA)" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="2"/>
                            <TextBox x:Name="textBox_adcmsr_idiag1" Height="23" TextWrapping="Wrap" Text="adcmsr_idiag1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="120" Grid.Column="2" IsEnabled="False" />
...
...

                        </Grid>
                    </TabItem>
                </TabControl>
            </TabItem>
        </TabControl>
        <GroupBox x:Name="group2" Header="Storing and sending configuration" Margin="10,0,10,79" VerticalAlignment="Bottom" Height="148">
            <Grid Margin="2,0,-3,1">
                <RadioButton x:Name="radio_conf_current" GroupName="conf_read" Content="Current conf" HorizontalAlignment="Left" Margin="8,5,0,0" VerticalAlignment="Top" IsChecked="True" FontSize="11" FontStyle="Italic" Checked="radio_conf_current_Checked" IsEnabled="False" Grid.ColumnSpan="2"/>
                <RadioButton x:Name="radio_conf_modif" GroupName="conf_read" Content="Modifying" HorizontalAlignment="Left" Margin="97,5,0,0" VerticalAlignment="Top" FontSize="11" FontStyle="Italic" Checked="radio_conf_current_Checked" IsEnabled="False"/>
                <Label x:Name="label_title" Content="Configuration title" HorizontalAlignment="Left" Margin="181,0,0,0" VerticalAlignment="Top" Width="106" FontStyle="Italic"/>
                <TextBox x:Name="textBox_title" HorizontalAlignment="Left" Height="23" Margin="295,2,0,0" TextWrapping="Wrap" Text="conf_title" VerticalAlignment="Top" Width="129" FontStyle="Italic" FontSize="11" MaxLines="1" MaxLength="1000"/>
                <Label x:Name="label_title_Corrupted" Content="" HorizontalAlignment="Left" Margin="439,2,0,0" VerticalAlignment="Top" Width="106" FontStyle="Italic"/>
                <Label Content="List of available configurations :" HorizontalAlignment="Left" Margin="10,23,0,0" VerticalAlignment="Top"/>
                <ListBox  x:Name="listBox_config" HorizontalAlignment="Left" Height="70" Margin="18,43,0,0" VerticalAlignment="Top" Width="420" SelectionChanged="listBox_config_SelectionChanged"/>
                <Button x:Name="btn_send_settings" Content="Send selected" HorizontalAlignment="Left" Margin="443,93,0,0" VerticalAlignment="Top" Width="109" Click="btn_send_settings_Click" IsEnabled="False" HorizontalContentAlignment="Center"/>
            </Grid>
        </GroupBox>
        <Grid Margin="10,0,10,5" VerticalAlignment="Bottom">
...
...
        </Grid>

    </Grid>
</Window>

0 голосов
/ 25 февраля 2020

Попробуйте добавить больше элементов управления, чтобы размер вашего окна был меньше текущего содержимого, чтобы высота текущего вида была больше, чем у существующих компонентов, поэтому потребуется полоса прокрутки. следовательно, ваша полоса прокрутки отображается соответственно.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...