Visual Studio/WPF > 컨트롤 > ViewBox

운영 환경
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2

@ WPF 4.5 입문 by 오타 카즈키
No.2074/9985

ViewBox 컨트롤은 자식 요소를 축소하여 표시하는 컨트롤입니다.

Strech에 「None」, 「Fill」, 「Uniform」, 「UniformToFill」를 사용한 예가 소개되고 있다.

분광 에서 시도했다.

XAML
<Window x:Class="_170423_t1935_border.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:_170423_t1935_border"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <WrapPanel Margin="0, 30, 0, 0" Background="Black">
            <Viewbox Width="70" Height="50" Stretch="None">
                <Border BorderBrush="Violet" BorderThickness="15"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="Uniform">
                <Border BorderBrush="Blue" BorderThickness="5"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="Fill">
                <Border BorderBrush="LightBlue" BorderThickness="5"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="Uniform">
                <Border BorderBrush="LightGreen" BorderThickness="5"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="UniformToFill">
                <Border BorderBrush="Yellow" BorderThickness="5"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="Uniform">
                <Border BorderBrush="Orange" BorderThickness="5"></Border>
            </Viewbox>
            <Viewbox Width="70" Height="50" Stretch="UniformToFill">
                <Border BorderBrush="Red" BorderThickness="5"></Border>
            </Viewbox>
        </WrapPanel>
    </Grid>
</Window>



코레자나이로보 발진!

좋은 웹페이지 즐겨찾기