Silverlight – Change TextBlock Color from CS (Windows Phone 7)

I am a new developer of Windows Phone 7. I have TextBlock Text = “{Binding MyDate}” on the MainPage.xaml page.

How Change the color of this TextBlock from MainPage.xaml.cs?

First, you need to specify an x:Name attribute for the TextBlock element, such as X:NAME = ” myTextBlock”. After this is done, the TextBlock can be used in the code-behind as a field with the same name as x:Name.

To set the foreground color of the TextBlock, you can use something similar

myTextBlock.Foreground = new SolidColorBrush(someColor);

I am a new developer of Windows Phone 7. I On the MainPage.xaml page, there is TextBlock Text = “{Binding MyDate}”.

How to change the color of this TextBlock from MainPage.xaml.cs?

First, you need to specify an x:Name attribute for the TextBlock element, for example, X:NAME = “myTextBlock”. After this operation is completed, the TextBlock is in the code-behind Can be used as a field with the same name in x:Name.

To set the foreground color of the TextBlock, you can use something similar

< pre>myTextBlock.Foreground = new SolidColorBrush(someColor);

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4032 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.