窗口最大化时,画布不会最大化

时间:2013-02-11 04:42:16

标签: .net wpf xaml canvas

边框外侧画布Tag,现在我想根据窗口最大化

来最大化画布的大小
<ScrollViewer x:Name="scrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
    <Border BorderBrush="DarkGray" BorderThickness="1">
        <Canvas x:Name="canvas"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AllowDrop="True" Background="Transparent" PreviewDragOver="canvas_DragOver" PreviewDrop="canvas_Drop" Width="600" Height="500">
            <TextBlock x:Name="tb" AllowDrop="True" Text="WorkBench" TextAlignment="Center" Width="100" Height="20" Canvas.Left="258" Canvas.Top="0" ToolTip="Drag and Drop Tools Here" />
        </Canvas>
    </Border>
 </ScrollViewer>

0 个答案:

没有答案