1。给一个stop按钮赋予一个stop的图形。

如图:

Wpf 对象属性赋值---属性标签

 

 

 代码如下:

    

 1 <Window x:Class="wpfTest.MainWindow"
 2         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 3         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 4         xmlns:local="clr-namespace:wpfTest"
 5         Title="MainWindow" Height="350" Width="525">
 6     <Window.Resources>
 7         <local:Human x:Key="wtqHum" name="wtq" child="thisismyname" ></local:Human>
 8 
 9     </Window.Resources>
10   
11     <Grid>
12         
13         <Button Width="100" Height="30">
14             <Button.Content>
15                 <Rectangle Width="15" Height="15" Stroke="Blue" Fill="Red"></Rectangle>
16             </Button.Content>
17             
18         </Button>
19     </Grid>
20 </Window>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-02-07
猜你喜欢
  • 2022-02-13
  • 2021-09-18
  • 2022-12-23
  • 2021-10-11
  • 2022-02-27
  • 2022-12-23
  • 2022-02-03
相关资源
相似解决方案