zoukankan      html  css  js  c++  java
  • WPF(Grid , StackPanel布局等入门)

    <Window x:Class="TestOfXamlGrid.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 Background="LightSlateGray">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="7*"/>
                <ColumnDefinition Width="3*"/> 
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="33" />
                <RowDefinition Height="33" />
                <RowDefinition Height="33" />
                <RowDefinition Height="40" />
            </Grid.RowDefinitions>
            <TextBox x:Name="textBox1" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="5" />
            <TextBox x:Name="textBox2" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="5" />
            <TextBox x:Name="textBox3" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="1" Margin="5" />
            <TextBox x:Name="textBox4" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="1" Margin="5" />
            
            <Button x:Name="button1" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="1" Margin="5">
                <Image Source="Images/p001.png" Width="23" Height="23"/>
            </Button>
        </Grid>
    </Window>
    
    <Window x:Class="TestOfXmlns.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">
        <StackPanel Background="LightBlue">
            <TextBox x:Name="textBox1" Margin="5"/>
            <TextBox x:Name="textBox2" Margin="5"/>
            <!--啊呵呵,连注释的方式都和html很像-->
            <StackPanel Orientation="Horizontal">
                <TextBox x:Name="textBox3" Width="140" Margin="5"/>
                <TextBox x:Name="textBox4" Width="120" Margin="5"/>
            </StackPanel>
            
            <Button x:Name="button1" Margin="5" >
                <Image Source="Images/p001.png" Width="60" Height="80"/>
            </Button>
            
        </StackPanel>
    </Window>
    


  • 相关阅读:
    225. 用队列实现栈
    232. 用栈实现队列
    459.重复的子字符串(简单)
    28. 实现 strStr()(简单)
    剑指 Offer 58
    541. 反转字符串 II(简单)
    浏览器渲染页面的过程、重绘、重排以及页面优化
    隐藏一个元素的几种方法
    当我们在浏览器中输入一个URL后,发生了什么?
    Object.create() 和 new Object()、{} 的区别
  • 原文地址:https://www.cnblogs.com/wjchang/p/3671541.html
Copyright © 2011-2022 走看看