1

我无法让ScrollviewerWPF中工作。我想我做错了什么,但无法弄清楚是什么。我还确保我没有在StackPanel侧使用ScrollViewer。请注意,其中有 2 个,但似乎没有一个有效。

我确实尝试修复ScrollViewer父容器的大小以限制大小,这很有效,但这不是我想要做的。我想确保在调整窗口大小时,容器中的大小会适当增加。

这是我的代码,我确实更改了字符串和路径,因为这是客户端应用程序的一部分:

<Window x:Class="Common.Views.SomeView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wnd="clr-namespace:Common" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:uc="clr-namespace:Library.UI.Core;assembly=Library.UI.Core"
        xmlns:cocls="clr-namespace:Library.UI.Core;assembly=Library.UI.Core"
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
        ToolTipService.ShowOnDisabled="True"
        dx:ThemeManager.ThemeName="Office2007Silver" 
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen"            
        ResizeMode="CanResize"
        Title="Some Validation" IsTabStop="False" 
        Height="365" 
        Width="792" d:Height="700" d:Width="1000">    
    <Grid Background="{StaticResource BackgroundBrush}" x:Name="SomeGrid">
        <Grid.ColumnDefinitions>            
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Menu Name="MainMenu"  Background="{StaticResource BackgroundBrush}" Grid.Row="0" >            
        </Menu>

        <Rectangle Grid.Row="1" Style="{StaticResource ResourceKey=HorizontalRectangleBorderStyle}" />

        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <ToolBarTray HorizontalAlignment="Stretch" FlowDirection="LeftToRight"  Background="{StaticResource BackgroundBrush}" Grid.Column="0" x:Name="tlbartrayMaster" >
                <ToolBar Background="{StaticResource BackgroundBrush}" Style="{DynamicResource DefaultToolBarStyle}" Width="Auto" x:Name="tlbarMasterImgTools" IsTabStop="False">
                    <Button Name="NewToolBarButton" x:FieldModifier="public" Style="{StaticResource ResourceKey=ToolBarBtnStyle}"  
                            Command="{x:Static wnd:MyAppCommands.MyAppInsertCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}"
                         ToolTip="Insert (F5)" IsTabStop="False" 
                            IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type wnd:MainWindowBase},
                        Mode=FindAncestor},Path=CanInsert, Mode=TwoWay}">
                        <Image Source="pack://application:,,,/Common;component/Images/new.bmp" 
                               Style="{StaticResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>

                    <Button Name="SaveToolBarButton" x:FieldModifier="public" ToolTip="Save (F2)" Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            IsTabStop="False"  ToolTipService.ShowOnDisabled="True"
                             Command="{x:Static wnd:MyAppCommands.MyAppSaveCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}" 
                            IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type wnd:MainWindowBase}, 
                        Mode=FindAncestor},Path=CanSave, Mode=TwoWay}">
                        <Image Source="pack://application:,,,/Common;component/Images/Save.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>
                    <Separator/>

                    <Button Name="SearchToolBarButton" ToolTip="Search for a specific record (F4)"  Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            IsTabStop="False" 
                            Command="{x:Static wnd:MyAppCommands.MyAppSearchCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}" 
                            IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type wnd:MainWindowBase}, 
                        Mode=FindAncestor},Path=CanSearch, Mode=TwoWay}">
                        <Image Source="pack://application:,,,/Common;component/Images/Edit.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>
                    <Separator/>

                    <Button Name="CancelToolBarButton" Focusable="False" x:FieldModifier="public" ToolTip="Cancel (Esc)"  Style="{StaticResource 
                        ResourceKey=ToolBarBtnStyle}" IsTabStop="False"  ToolTipService.ShowOnDisabled="True" 
                             Command="{x:Static wnd:MyAppCommands.MyAppEscCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}" 
                            IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type wnd:MainWindowBase}, 
                        Mode=FindAncestor},Path=CanCancel, Mode=TwoWay}">
                        <Image Source="pack://application:,,,/Common;component/Images/Undo.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>

                    <Button Name="DeleteToolBarButton" x:FieldModifier="public" ToolTip="Delete (Shift+F2)"  Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            IsTabStop="False" 
                            Command="{x:Static wnd:MyAppCommands.MyAppDeleteCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}" 
                            IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type wnd:MainWindowBase}, 
                        Mode=FindAncestor},Path=CanDelete, Mode=TwoWay}">
                        <Image Source="pack://application:,,,/Common;component/Images/Bin.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>
                    <Separator/>

                    <Button Name="CalculatorToolBarButton" ToolTip="Activate Calculator" Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            Command="{x:Static wnd:MyAppCommands.MyAppCalculatorCommand}" CommandTarget="{Binding ElementName=SomeValidationGrid}" 
                        IsTabStop="False" IsEnabled="True">
                        <Image Source="pack://application:,,,/Common;component/Images/Calculator.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16"/>
                    </Button>


                    <Button x:Name="PrintToolBarButton" Style="{StaticResource ResourceKey=ToolBarBtnStyle}" ToolTip="View/Print Report"  
                            IsTabStop="False" >
                        <Image  Source="pack://application:,,,/Common;component/Images/Print.bmp" 
                                Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>

                    <Button x:Name="HelpToolBarButton"  Visibility="Collapsed" Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            ToolTip="Access help on current subject"  IsTabStop="False"  >
                        <Image Source="pack://application:,,,/Common;component/Images/information.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>


                    <Button x:Name="SearchParticipantToolbarButton" Style="{StaticResource ResourceKey=ToolBarBtnStyle}" 
                            ToolTip="Search for Participant/Entity/Member"  IsTabStop="False" >
                        <Image Source="pack://application:,,,/Common;component/Images/Candle.bmp" 
                               Style="{DynamicResource ImageOpacityStyle}" Height="16" Width="16" />
                    </Button>
                    <Separator/>
                </ToolBar>

                <ToolBar  x:Name="MyCompImageToolbar" HorizontalAlignment="Stretch" FlowDirection="LeftToRight"  IsTabStop="False"  
                          Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ToolBarTray}}}" 
                          Style="{DynamicResource DefaultToolBarStyle}" MaxHeight="1000" ToolBarTray.IsLocked="True">
                    <Label x:Name="ToolBarMessageLabel" HorizontalContentAlignment="Center" Foreground="#000084" FontWeight="Bold" Margin="50,0,0,0"/>
                </ToolBar>
            </ToolBarTray>

            <TextBlock Grid.Column="1" >
                <Hyperlink NavigateUri="http://MyComp-software.com" Foreground="Transparent" ToolTip="http://MyComp-software.com">
                    <Image Source="pack://application:,,,/Common;component/Images/MyCompLogo.bmp" 
                            VerticalAlignment="Stretch"
                           Style="{StaticResource DefaultMenuTabImgStyle}"  />
                </Hyperlink>
            </TextBlock>
        </Grid>

        <Rectangle Grid.Row="3" Style="{StaticResource ResourceKey=HorizontalRectangleBorderStyle}" />

        <Grid Grid.Column="0" Grid.Row="4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".5*"/>
                <ColumnDefinition Width="1"/>
                <ColumnDefinition Width=".5*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ErrorStringGrid" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3">
                <TextBlock x:Name="ErrorText" Text="{Binding Path=ErrorString}" Foreground="Red" />
            </Grid>
            <Grid x:Name="SomeToValidateSectionGrid" Grid.Column="0" Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <Grid x:Name="SomeToValidateSection1Grid" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Some To Validate" FontWeight="Bold" Grid.Row="0" HorizontalAlignment="Center" />
                    <ScrollViewer CanContentScroll="True" IsDeferredScrollingEnabled="False" VerticalScrollBarVisibility="Auto" Width="Auto" Grid.Row="1">
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock x:Name="txtblSomeBlockToValidate" Foreground="{StaticResource BlueTextBrush}" Height="42" HorizontalAlignment="Center" />
                            <TextBlock Text="Some Details:" FontWeight="Bold" HorizontalAlignment="Center"/>
                            <Grid HorizontalAlignment="Center">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="0" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="1" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="2" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="3" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="4" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="5" />
                                <TextBlock Text="Some1:" Grid.Column="0" Grid.Row="6" />

                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="0" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="1" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="2" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="3" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="4" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="5" />
                                <TextBlock Text="{Binding Some1}" Grid.Column="1" Grid.Row="6" />
                            </Grid>
                        </Grid>
                    </ScrollViewer>
                </Grid>

                <Grid x:Name="SomeToValidateSection2Grid" Grid.Row="1">
                    <Expander Name="MyAppExpander" IsExpanded="False" Height="Auto" Style="{DynamicResource ExpanderStyle4}"
                        BorderThickness="2" BorderBrush="#FFBA8B8B" Opacity="1" IsTabStop="False" HorizontalAlignment="Stretch">
                        <Expander.Header>
                            <StackPanel HorizontalAlignment="Stretch">
                                <TextBlock Text="More Information" HorizontalAlignment="Center" TextDecorations="Underline" Foreground="#0054E3"/>
                            </StackPanel>
                        </Expander.Header>
                        <Border BorderThickness="1,0,0,0" BorderBrush="#FFBA8B8B" Background="White" Height="Auto"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <StackPanel x:Name="panelBanks">
                                <TextBlock Text="{Binding AdditionalInfo}" HorizontalAlignment="Center" Height="61" />
                            </StackPanel>
                        </Border>
                    </Expander>
                </Grid>
            </Grid>

            <GridSplitter Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>

            <Grid x:Name="SuggestedSomeGrid" Grid.Column="2" Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Suggested Validation Some" FontWeight="Bold" Grid.Row="0" HorizontalAlignment="Center"/>
                <ScrollViewer CanContentScroll="True" IsDeferredScrollingEnabled="False" VerticalScrollBarVisibility="Auto" Width="Auto" Grid.Row="1">
                    <Grid ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible">

                        <TextBlock x:Name="txtblSomeBlockValidated" Foreground="{StaticResource BlueTextBrush}" Height="42" HorizontalAlignment="Stretch" />
                        <TextBlock Text="Some Details:" FontWeight="Bold" HorizontalAlignment="Center"/>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".5*"/>
                                <ColumnDefinition Width=".5*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Text="Some1:"  Grid.Row="0" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="1" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="2" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="3" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="4" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="5" Grid.Column="0"/>

                            <TextBlock Text="Some1:"  Grid.Row="6" Grid.Column="0" Margin="0,10,0,0"/>
                            <TextBlock Text="Some1:"  Grid.Row="7" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="8" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="9" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="10" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="11" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="12" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="13" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="14" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="15" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="16" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="17" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="18" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="19" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="20" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="21" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="22" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="23" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="24" Grid.Column="0"/>
                            <TextBlock Text="Some1:"  Grid.Row="25" Grid.Column="0"/>

                            <TextBlock Text="{Binding Some1}"  Grid.Row="0" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="1" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="2" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="3" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="4" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="5" Grid.Column="1"/>

                            <TextBlock Text="{Binding Some1}"  Grid.Row="6" Grid.Column="1" Margin="0,10,0,0"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="7" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="8" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="9" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="10" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="11" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="12" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="13" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="14" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="15" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="16" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="17" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="18" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="19" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="20" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="21" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="22" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="23" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="24" Grid.Column="1"/>
                            <TextBlock Text="{Binding Some1}"  Grid.Row="25" Grid.Column="1"/>
                        </Grid>
                    </Grid>
                </ScrollViewer>
                <StackPanel Orientation="Horizontal" Grid.Row="2" >
                    <Button x:Name="btnAcceptSuggested" Margin="0,0,10,0" IsTabStop="True" 
                            TabIndex="5" Height="28" Width="132" Click="btnAcceptSuggested_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Name="imgAcceptSuggestion" 
                                   Source="pack://application:,,,/Common;component/Images/Some1.bmp" Margin="0,0,5,0"/>
                            <TextBlock Name="txtblAcceptSuggested">
                        <Underline>A</Underline>ccept Suggested
                            </TextBlock>
                            <AccessText Text="_A" Height="0" Width="0"/>
                        </StackPanel>
                    </Button>
                    <Button x:Name="btnValidateSome" Margin="0,0,10,0" IsTabStop="True" 
                            TabIndex="5" Height="28" Width="132" Click="btnValidateSome_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Name="imgAcceptSuggestion1" 
                                   Source="pack://application:,,,/Common;component/Images/Some1.bmp" Margin="0,0,5,0"/>
                            <TextBlock Name="txtblValidateSome" Grid.Column="1">
                                Show me <Underline>M</Underline>ore
                            </TextBlock>
                            <AccessText Text="_M" Height="0" Width="0"/>
                        </StackPanel>
                    </Button>
                    <Button x:Name="btnUndo" Margin="0,0,10,0" IsTabStop="True" Visibility="Collapsed" 
                            TabIndex="5" Height="28" Width="132" Click="btnUndo_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Name="imgAcceptSuggestion2" 
                                   Source="pack://application:,,,/Common;component/Images/Some1.bmp" Margin="0,0,5,0"/>
                            <TextBlock Name="txtblUndo" Grid.Column="1">
                        <Underline>U</Underline>ndo
                            </TextBlock>
                            <AccessText Text="_U" Height="0" Width="0"/>
                        </StackPanel>
                    </Button>
                    <Button x:Name="btnOverrideSuggested" Margin="0,0,10,0" IsTabStop="True" 
                            TabIndex="5" Height="28" Width="140" ToolTip="Override suggested validated Some." Click="btnOverrideSuggested_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Name="imgAcceptSuggestion3" 
                                   Source="pack://application:,,,/Common;component/Images/Some1.bmp" Margin="0,0,5,0"/>
                            <TextBlock Name="txtblOverrideSuggested" Grid.Column="1">
                        <Underline>O</Underline>verride Suggested
                            </TextBlock>
                            <AccessText Text="_O" Height="0" Width="0"/>
                        </StackPanel>
                    </Button>
                </StackPanel>
            </Grid>
        </Grid>

        <Rectangle x:Name="rectRowBorder_Row05" Grid.Row="5" Style="{StaticResource ResourceKey=HorizontalRectangleBorderStyle}" />

        <StackPanel Grid.Row="6" Orientation="Horizontal"  VerticalAlignment="Center" Margin="0,5,0,5">
            <Button x:Name="btnCancel" Margin="0,0,10,0" IsTabStop="True" 
                            TabIndex="5" Height="28" Width="132" IsCancel="True">
                <StackPanel Orientation="Horizontal">
                    <Image Name="imgCancel" 
                                   Source="pack://application:,,,/Common;component/Images/Cancel.bmp" Margin="0,0,5,0"/>
                    <TextBlock Name="txtblCancel" Grid.Column="1">
                        <Underline>C</Underline>ancel
                    </TextBlock>
                    <AccessText Text="_C" Height="0" Width="0"/>
                </StackPanel>
            </Button>
        </StackPanel>


    </Grid>
</Window>

抱歉,代码很大,但这就是我所拥有的。另外,请发表评论以反对投票。

4

0 回答 0