I have a project to be done in Silverlight. The project has a grid with 31 hyperlinkButtons that are named hyperlinkButton1-31 corresponding to the no. of days in january. I'm trying write a conditioned statment that will change the background color of a specific hyperlinkbutton in a specific day, or even better if i can select or highlight it. So if the day is 15 of january then the background property of hyperlinkButton15 will be black.
The code which i think it should do it but it is giving me error is:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
int d;
d = DateTime.Today.Day;
int i;
for (i = 1; i <= d; i++)
{
if (i==d)
{
(hyperlinkButton{0},i).background= new SolidColorBrush(Colors.Black); //Here it should be something like this but i'm not sure how to do it
}
}
You have a simple error in your coding.
You wrote the following line:
The Colors.Black property needs to be surrounded in parentheses, like this: