一个简单的栅格响应布局

这篇博客介绍了如何在WPF中创建一个简单的栅格响应布局,通过代码示例和实际效果展示,阐述了在界面缩放时布局的自适应性。
摘要由CSDN通过智能技术生成

代码:

<UserControl x:Class="MXS_WPF.View.DoctorOrders.UC_NursingRecord"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MXS_WPF.View.DoctorOrders"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d"
             FontFamily="华文新魏"
             Loaded="NursingRecord_Loaded">
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="36"/>
            <RowDefinition Height="0.2"/>
            <RowDefinition Height="2"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <!--病人信息与查询框 开始-->
        <Grid  Grid.Row="0" Background="#FFFFFF">
            <Grid Grid.Column="0" Height="36">
                <TextBlock.FontSize>18</TextBlock.FontSize>
                <TextBlock.Foreground>#888888</TextBlock.Foreground>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="0.3*"/>
                    <ColumnDefinition Width="0.4*"/>
                    <ColumnDefinition Width="0.3*"/>
                    <ColumnDefinition Width="0.7*"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <!--查询输入框 开始-->
                <WrapPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left">
                    <TextBlock Text="病人:"/>
                    <TextBox BorderBrush="Black" x:Name="SelectTextBox"
                         AutomationProperties.HelpText="住院号搜索"
                         Foreground="#555555" 
                         FontSize="16" Width="200" Height="25"
                         VerticalContentAlignment="Center"
                         MaxLength="12"
                         KeyUp="SelectPatient"/>
                </WrapPanel>
                <!--查询输入框 结束-->
                <WrapPanel Grid.Column="1" Margin="0,8.5,0,0">
                    <TextBlock Te
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值