通过Uid属性控制TextBlock组件的字体颜色
来源:互联网 发布:指南针软件诈骗 编辑:程序博客网 时间:2024/05/20 03:39
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cl="clr-namespace:System.Collections;assembly=mscorlib"
Title="MainWindow" Height="250" Width="450">
<Window.Resources>
<Style TargetType="{x:Type TextBlock}" x:Key="textBlockTest">
<Style.Triggers>
<Trigger Property="Uid" Value="0">
<Setter Property="Foreground" Value="#EEEEEE" />
</Trigger>
<Trigger Property="Uid" Value="1">
<Setter Property="Foreground" Value="#000000" />
</Trigger>
<Trigger Property="Uid" Value="2">
<Setter Property="Foreground" Value="#FFFFFF" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<!-- <Button Style="{StaticResource highlightStyle}" Content="Hight Value" x:Name="btnVisible" Click="Button_Click" />-->
<TextBlock Style="{StaticResource textBlockTest}" Text="TestTrigger" VerticalAlignment="Center" HorizontalAlignment="Center" Uid="1"/>
</Grid>
</Window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:cl="clr-namespace:System.Collections;assembly=mscorlib"
Title="MainWindow" Height="250" Width="450">
<Window.Resources>
<Style TargetType="{x:Type TextBlock}" x:Key="textBlockTest">
<Style.Triggers>
<Trigger Property="Uid" Value="0">
<Setter Property="Foreground" Value="#EEEEEE" />
</Trigger>
<Trigger Property="Uid" Value="1">
<Setter Property="Foreground" Value="#000000" />
</Trigger>
<Trigger Property="Uid" Value="2">
<Setter Property="Foreground" Value="#FFFFFF" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<!-- <Button Style="{StaticResource highlightStyle}" Content="Hight Value" x:Name="btnVisible" Click="Button_Click" />-->
<TextBlock Style="{StaticResource textBlockTest}" Text="TestTrigger" VerticalAlignment="Center" HorizontalAlignment="Center" Uid="1"/>
</Grid>
</Window>
0 0
- 通过Uid属性控制TextBlock组件的字体颜色
- gui字体颜色的控制和常用组件
- 控制的字体属性
- Android TextView中文字通过SpannableString来设置不同的属性:超链接、颜色、字体等属性
- html中通过文字控制文本的颜色和字体(简单演示)
- 彩票案例-导航栏属性控制-字体,颜色等
- win 8 控件TextBlock的一些属性
- Unity控制台控制输出字体的颜色
- C++控制输出的字体颜色
- Python中字体颜色的控制
- 状态栏字体颜色控制
- Eclipse字体颜色控制
- #java#设置textfield或其他组件字体的颜色
- 通过进度条控制颜色
- AndroidManifest.xml中四大组件的permission、 android:exported 属性详解和UID机制
- 通过刚体组件控制物体的运动
- 通过刚体组件控制物体的移动
- ALV 输出控制字体颜色
- 换个角度看微软:每年饮料费2300万
- qml学习------------GridLayout
- 结构体struct简介(上)
- 关东升的iOS实战系列图书 《iOS实战:传感器卷(Swift版)》已经上市
- Java程序设计中setFont()函数的用法(转)
- 通过Uid属性控制TextBlock组件的字体颜色
- Pragmatic thinking and learning-Refactor your wetware
- 关于java重载(重载方法匹配优先级)
- C/C++编译的程序占用的内存分配
- eclipse 中各种小图标含义
- VC++中生成DLL和LIB文件
- HttpUtil
- 下載北風資料庫(NORTHWIND)
- PPT转为PDF格式的方法汇总