lundi 13 avril 2015

Windows phone 8.1 accessing buttons

i am trying to access buttons in my xaml page. i will make their foreground red. but i cannot access them.



for (int i = 1; i <= 10; i++)
{
Button button = this.FindName("Button_" + i);
button.IsEnabled = false;
button.Foreground = new SolidColorBrush(Colors.Red);

}


The error is :


Error 2 Cannot implicitly convert type 'object' to 'Windows.UI.Xaml.Controls.Button'. An explicit conversion exists (are you missing a cast?) C:\Users\Admin\documents\visual studio 2013\Projects\Sayı TahminEt\Sayı TahminEt\Game.xaml.cs 61 33 Sayı TahminEt


Aucun commentaire:

Enregistrer un commentaire