WPF Window 窗口 常用属性
window窗口属性
属性 |
定义 |
属性值 |
注解 |
WindowStartupLocation | 获取或设置窗口首次显示时的位置。 | 一个 WindowStartupLocation 值,指定窗口首次显示时的顶边/左边位置。 默认值为 Manual。 |
将 将 将 |
Background | 设置窗口背景(背景透明度) | Background="Transparent" | |
FontFamily | 设置窗口字体 | FontFamily="Microsoft YaHei" | |
FontSize | 设置字体大小 | FontSize="12" | |
FontWeight | 字休加粗 | FontWeight="ExtraLight" | |
Title | 标题 | ||
Height | 高度 | ||
Width | 宽度 | ||
Name | 名称 | ||
WindowChrome.WindowChrome | 获取或设置附加到窗口的 WindowChrome 的实例。 |
<Window x:Class="cjh.Automatic.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:cjh.Automatic" mc:Ignorable="d" WindowStartupLocation="CenterScreen" Background="Transparent" FontFamily="Microsoft YaHei" FontSize="12" FontWeight="ExtraLight" Title="XX管理平台" Height="700" Width="1150" Name="windowMain"> <WindowChrome.WindowChrome> <WindowChrome GlassFrameThickness="-1" /> </WindowChrome.WindowChrome> <Grid> <Grid.Background> <RadialGradientBrush> <GradientStop Color="#FF285173" Offset="0" /> <GradientStop Color="#FF244967" Offset="0.3" /> <GradientStop Color="#FF14273A" Offset="1" /> </RadialGradientBrush> </Grid.Background> <Grid.RowDefinitions> <RowDefinition Height="45"/> <RowDefinition /> <RowDefinition Height="20"/> </Grid.RowDefinitions> </Grid> </Window>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具