WPF-Base/WPF基础-1/MainWindow.xaml

48 lines
2.3 KiB
Plaintext
Raw Permalink Normal View History

2024-12-28 22:36:52 +08:00
<Window x:Class="WPF基础_1.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"
mc:Ignorable="d"
2025-01-25 23:06:31 +08:00
Icon="public/images/1.png" Title="我的xxx" Height="450" Width="800"> <!-- 设置图标 Icon 设置标题 Title -->
2024-12-28 22:36:52 +08:00
<Grid Name="Grid">
2025-01-25 23:06:31 +08:00
<!-- 设置整个背景色 -->
2024-12-28 22:36:52 +08:00
<Grid.Background>
<LinearGradientBrush>
2025-01-25 23:06:31 +08:00
<!-- 启用线性渐变 -->
2024-12-28 22:36:52 +08:00
<LinearGradientBrush.GradientStops>
2025-01-25 23:06:31 +08:00
<!-- Offset 偏移量每个颜色分布位置 -->
2024-12-28 22:36:52 +08:00
<GradientStop Offset="0.00" Color="Red" />
<GradientStop Offset="0.50" Color="Indigo" />
<GradientStop Offset="1.00" Color="Violet" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Grid.Background>
2025-01-25 23:06:31 +08:00
<!-- 定义行数,也有 Grid.ColumnDefinitions -->
2024-12-28 22:36:52 +08:00
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10,10,13,10" TextWrapping="Wrap"
2025-01-25 23:06:31 +08:00
Grid.Row="0" Name="TextQuestion" FontFamily="Verdana" FontSize="24" Foreground="Green">
2024-12-28 22:36:52 +08:00
有什么问题吗
</TextBox>
<Button VerticalAlignment="Top" Name="CmdAnswer" HorizontalAlignment="Left" Margin="10,0" Width="127"
Height="23" Grid.Row="1">
<Button.Foreground>
<x:Static Member="SystemColors.GradientActiveCaptionBrush" />
</Button.Foreground>
<!-- <Rectangle Fill="Blue" Height="10" Width="100" /> -->
&lt; &quot; 你想问什么 &quot; &gt;
</Button>
<TextBox Grid.Row="2" Name="TextAnswer" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Margin="10,10,13,10" FontSize="24" Foreground="Green">
回答就在这关于xaml受到一些影响[&lt;] [&gt;] " "
</TextBox>
</Grid>
</Window>