zoukankan      html  css  js  c++  java
  • WPF中Auto与*的差别

    Auto 表示自己主动适应显示内容的宽度, 如自己主动适应文本的宽度,文本有多长,控件就显示多长.

    * 则表示按比例来分配宽度.


    <ColumnDefinition Width="3*" />
    <ColumnDefinition Width="7*" />

    enter image description here

    相同,行能够这样定义

    <RowDefinition Height="3*" />
    <RowDefinition Height="7*" />

    这些数字能够是小数.
    假设数字缺省,则默认是1.
    在这个样例中, 列2的宽度是列1的1.5倍.

    <ColumnDefinition Width="1.5*" />
    <ColumnDefinition />

    Column 1: 1.5*, Column 2 1* (implied)

    Auto和*能够混合使用. 在这个样例中,后两行的宽度在前两行分配完之后,按比例获取剩余的宽度.

    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />  <!-- Auto-fit to content, 'Hi' -->
        <ColumnDefinition Width="50.5" />  <!-- Fixed  50.5 device units) -->
        <ColumnDefinition Width="69*" />   <!-- Take 69% of remainder -->
        <ColumnDefinition Width="31*"/>    <!-- Take 31% of remainder -->
    </Grid.ColumnDefinitions>
    <TextBlock Text="Hi" Grid.Column="0" />

    enter image description here


  • 相关阅读:
    python排序
    python中常用的九种数据预处理方法分享
    8089汇编 源程序
    8086汇编 栈操作
    8089汇编 运算符指令
    8089汇编 标志寄存器
    8086汇编 段寄存器
    8086汇编 Debug 使用
    8086汇编 CPU 寄存结构
    8086汇编 内存交互
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/4001964.html
Copyright © 2011-2022 走看看