当前位置:网站首页>WPF interface layout must know basis
WPF interface layout must know basis
2022-07-29 07:16:00 【Jinan medical applet champion】
WPF Basic knowledge of interface layout
<Window x:Class="WpfApp1728.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:WpfApp1728"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<!--<DockPanel>
<Button Content="top Button" DockPanel.Dock="Top" Height="135" Width="370" ></Button>
</DockPanel>-->
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<!-- Line definition 3 That's ok 4 Definition of columns -->
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!-- Column definition -->
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Left Top Button" />
<!--1 Designated line Grid.Row="2" 2 Specified column Grid.Column="3" Position of control button . Make good use of additional attributes , That's enough .-->
<Button Content="Right Bottom Top Button" Grid.Row="2" Grid.Column="3" />
</Grid>
</Window>
<Window x:Class="WpfApp1728.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:WpfApp1728"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<!--<DockPanel>
<Button Content="top Button" DockPanel.Dock="Top" Height="135" Width="370" ></Button>
</DockPanel>-->
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<!-- Line definition 3 That's ok 4 Definition of columns -->
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!-- Column definition -->
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Left Top Button" />
<!--1 Designated line Grid.Row="2" 2 Specified column Grid.Column="3" Position of control button . Make good use of additional attributes , That's enough .-->
<Button Content="Right Bottom Top Button" Grid.Row="2" Grid.Column="3" />
<!-- Cross column design properties Grid.ColumnSpan-->
<Button Content="ColumnSpan Button" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" />
<!-- Cross line properties Grid.RowSpan-->
<Button Content="RowSpan Button" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3"/>
</Grid>
</Window>
effect

Minimum width setting , The minimum compression setting is also called .
<Button Content="Left Top Button" MinWidth="80" />
Minimum width
<!-- Column definition -->
<ColumnDefinition MinWidth="100" Width="*"/>
effect

The adaptive ( To the same height as the text ) auto Code and effect
<!-- Line definition 3 That's ok 4 Definition of columns -->
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>

Inside and outside the margin

<Button Content="Right Bottom Top Button" Grid.Row="2" Margin="10,10,10,10" Grid.Column="3" />
Outer margin effect
边栏推荐
- CVPR2021| 基于自监督学习的多视图立体匹配 (CVPR2021)
- 以太网接口介绍
- Redis Basics
- WPF 界面布局必知基础
- Image noise and matrix inversion
- It's enough for MySQL to have this article (disgusting and crazy typing 37k words, just for Bo Jun's praise!!!)
- 2022-07-28: what is the output of the following go language code? A:AA; B:AB; C:BA; D:BB。 package main import ( “fmt“ ) func main() { f
- Fillder use
- Excel文件读写(创建与解析)
- 【C语言刷LeetCode】2332. 坐上公交的最晚时间(M)
猜你喜欢

对Vintage分析的一些学习理解

MutationObserver文档学习

Excel file reading and writing (creation and parsing)

后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)

Summary of OCR optical character recognition methods

Ethernet interface introduction

Flink real-time warehouse DWD layer (transaction domain - additional purchase dimension degradation processing) template code

建木持续集成平台v2.5.2发布

Vite3.0都发布了,你还能卷得动吗(新特性一览)

Vmware16 create virtual machine: cannot create a new virtual machine, do not have permission to perform this operation
随机推荐
图像加噪声与矩阵求逆
Unity exploration plot access design analysis & process + code specific implementation
Excel文件读写(创建与解析)
IO stream - file - properties
20-40k | mecarmand 3D vision algorithm / software / Product Manager Recruitment
win11VMware打开虚拟机就蓝屏重启以及启动不了的解决方案
Flink实时仓库-DWD层(交易域-加购维度退化处理)模板代码
JS 鸡生蛋与蛋生鸡问题,Object与Function究竟谁出现的更早?Function算不算Function的实例?
VMware16安装虚拟机遇到的问题
Image noise and matrix inversion
2D cartoon rendering - advanced skills
Unity sends a post request to the golang server for parsing and returning
Remote invocation of microservices
Redis基础篇
聊天机器人有何用处?有何类型?看完这些就明白了!
Flink实时仓库-DWD层(下单-多张表实现join操作)模板代码
fillder使用
Vite3.0 has been released, can you still roll it (list of new features)
WPF嵌套布局案例
Ethernet interface introduction