Reputation: 11
I want to check my foreground color of my tapped textblock..
The code I have used is
If(textblock.foreground.equals(system.media.color.fromargb(100,0,255,0)))
Messagebox.show("got it ")";
This code is not working can any one help me??
Edited :- I want to check the color of 4 textblock.. I know the index value of the the textblock..
Upvotes: 1
Views: 59
Reputation: 36
Try this:
private void TextBlock_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
if(((sender as TextBlock).Foreground as SolidColorBrush).Color.Equals(Colors.Green))
{
MessageBox.Show("It is green");
}
}
Upvotes: 1