zoukankan      html  css  js  c++  java
  • Border 控件

    Border:在另一个对象的周围绘制边框、背景或同时绘制二者。

    <Window x:Class="MaterialStorage.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <!--在这里给网格定义了三行一列 第一行高20 第三行高20 其余的自适应-->
            <Grid.RowDefinitions>
                <RowDefinition Height="20"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="20"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" ></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Grid.Row="0">按钮1</Button>
            <!-- Border 被单独拿出来,用于为一些容器绘制边框-->
            <Border BorderThickness="3" BorderBrush="Black" Grid.Row="1">
                <StackPanel Background="LightGray" Width="200" Height="60">
                    <TextBlock Text="AutoCompleteBox Control" Width="90"/>
                </StackPanel>
            </Border>
            <Button Grid.Row="2">按钮3</Button>
        </Grid>
    </Window>

    需要注意这里的黑色边框,他填满了整个第二行。

  • 相关阅读:
    背包解法
    第十六周周总结
    软件工程个人课程总结
    学期课后个人总结
    spring事务
    梦断代码03
    团队冲刺的第二十四天
    第十五周周总结
    百度输入法评价
    找到水王
  • 原文地址:https://www.cnblogs.com/zhuzhenyu/p/2937236.html
Copyright © 2011-2022 走看看