读书人

当test.jpg大小超过Grid大小时就出现滚

发布时间: 2012-11-07 09:56:10 作者: rapoo

当test.jpg大小超过Grid大小时就出现滚动条,请前辈指导下!先感谢了!
背景:下面一段代码是一个窗口里边放了一幅背景图片test.jpg。
问题:由于我的背景需发动态替换,所以想当test.jpg大小超过Grid大小时就出现滚动条,请前辈指导下!

C# code
<UserControl x:Class="LandQualityViewerApplication.AddIns.StatisticsResultWindow"    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:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"     mc:Ignorable="d"    d:DesignHeight="411" d:DesignWidth="780">    <toolkit:BusyIndicator x:Name="StatisticsBusy">        <Grid Width="748" Height="322" Name="reportGrid">            <Grid.Background>                <ImageBrush Stretch="None" ImageSource="/taizi.AddIns;component/Images/test.jpg"/>            </Grid.Background>                               </Grid>    </toolkit:BusyIndicator></UserControl>


[解决办法]
外面套个ScrollViewer应该就可以解决了吧
[解决办法]
探讨

外面套个ScrollViewer应该就可以解决了吧

读书人网 >CAD教程

热点推荐