• WPF Window 窗口 常用属性


    window窗口属性

    属性

    定义

    属性值

    注解

     WindowStartupLocation 获取或设置窗口首次显示时的位置。 一个 WindowStartupLocation 值,指定窗口首次显示时的顶边/左边位置。 默认值为 Manual 

    将 WindowStartupLocation 属性设置为 Manual 使窗口按其 Left 和 Top 属性值定位。 Left如果未指定或Top属性,则其值由Windows确定。

    将 WindowStartupLocation 属性设置为 CenterScreen 使窗口定位在包含鼠标光标的屏幕中心

    将 WindowStartupLocation 属性设置为 CenterOwner 使窗口定位在其所有者窗口的中心, (如果指定,则会看到 Window.Owner) 。 所有者窗口可以是另一个 WPF 窗口或非 WPF 窗口。

     Background 设置窗口背景(背景透明度) Background="Transparent"
     FontFamily 设置窗口字体 FontFamily="Microsoft YaHei"
     FontSize 设置字体大小 FontSize="12"
     FontWeight 字休加粗 FontWeight="ExtraLight"
     Title标题
     Height 高度
     Width 宽度
     Name 名称
    WindowChrome.WindowChrome获取或设置附加到窗口的 WindowChrome 的实例。
    1. <Window x:Class="cjh.Automatic.MainWindow"
    2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    6. xmlns:local="clr-namespace:cjh.Automatic"
    7. mc:Ignorable="d"
    8. WindowStartupLocation="CenterScreen" Background="Transparent"
    9. FontFamily="Microsoft YaHei" FontSize="12" FontWeight="ExtraLight"
    10. Title="XX管理平台" Height="700" Width="1150" Name="windowMain">
    11. <WindowChrome.WindowChrome>
    12. <WindowChrome GlassFrameThickness="-1" />
    13. </WindowChrome.WindowChrome>
    14. <Grid>
    15. <Grid.Background>
    16. <RadialGradientBrush>
    17. <GradientStop Color="#FF285173" Offset="0" />
    18. <GradientStop Color="#FF244967" Offset="0.3" />
    19. <GradientStop Color="#FF14273A" Offset="1" />
    20. </RadialGradientBrush>
    21. </Grid.Background>
    22. <Grid.RowDefinitions>
    23. <RowDefinition Height="45"/>
    24. <RowDefinition />
    25. <RowDefinition Height="20"/>
    26. </Grid.RowDefinitions>
    27. </Grid>
    28. </Window>

  • 相关阅读:
    数据结构实验
    Mysql计算一行最大最小值
    整个文档怎么翻译?这些方法亲测实用
    面向对象的特点
    python习题004--使用python实现ATM机效果
    VUE3-工作笔记05
    【Unity记录】【解析几何】令文本保持字符间距地环绕在圆弧上(将线段映射到圆弧上)
    【扫盲】YOLOV7训练
    CSS3 新增属性-边框圆角-文字阴影-盒子阴影
    配置文件的读取-TOML
  • 原文地址:https://blog.csdn.net/cjh16606260986/article/details/136613825