当前位置:网站首页>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
边栏推荐
- MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
- Google fragmented notes JWT (Draft)
- Remote invocation of microservices
- Can MySQL export tables regularly?
- 20-40K| 梅卡曼德3D视觉算法/软件/产品经理招聘
- 太空射击第17课: Game Over (結束)
- 【Redis】Redis开发规范与注意事项
- 解决CSDN因版权不明而无法发布博客的问题
- Flink real-time warehouse DWD layer (Kafka associated with MySQL lookup join) template code
- win11VMware打开虚拟机就蓝屏重启以及启动不了的解决方案
猜你喜欢

Comparison of advantages between can & canfd integrated test analysis software lkmaster and PCA Explorer 6 analysis software

MySQL----多表查询

Win11vmware turns on the virtual machine and restarts on the blue screen and the solution that cannot be started

聊天机器人有何用处?有何类型?看完这些就明白了!

做开发4年13K,想转行自动化测试,薪资还能涨吗···

Unity exploration plot access design analysis & process + code specific implementation

Decompilation of wechat applet

SSH password free login - two virtual machines establish password free channel two-way trust

After 4 years of development and 13K, if you want to change to automated testing, can your salary still rise···

ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘解决方法
随机推荐
Vite3.0 has been released, can you still roll it (list of new features)
Image noise and matrix inversion
解决CSDN因版权不明而无法发布博客的问题
gin 中间件
LeetCode 879. 盈利计划
[redis] redis development specifications and precautions
Flink real-time warehouse DWD layer (transaction domain - additional purchase dimension degradation processing) template code
Vite3.0都发布了,你还能卷得动吗(新特性一览)
npm install报错npm ERR Could not resolve dependency npm ERR peer
MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
[solution] error: lib/bridge_ generated. dart:837:9: Error: The parameter ‘ptr‘ of the method ‘FlutterRustB
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
我的创业邻居们
Revolution of game assets
Kubernetes (V) -- deploy kubernetes dashboard
2D cartoon rendering - advanced skills
Unity free element special effect recommendation
dba
Flink实时仓库-DWD层(交易域-加购维度退化处理)模板代码
【C语言刷LeetCode】2332. 坐上公交的最晚时间(M)