locked
Iam not able to access the Colors class in windows store apps RRS feed

  • Question

  • Button btn = new Button();

    btn.Height = 50;

    btn.Width = 150;

    btn.Content = "Click ME";

    btn.Background = new SolidColorBrush(Colors.Orange);

    btn.Foreground = new SolidColorBrush(Colors.Black);

    Iam not able to access the Colors class  in windows store apps .getting the error that "Colors " is not in the current context.

    Please let me know how to provide the color to button though code


    amair

    Thursday, November 7, 2013 12:05 PM

Answers

  • Hello amair,

    Add reference of windows.ui.

    using Windows.UI;

    • Proposed as answer by Sachin S Thursday, November 7, 2013 2:04 PM
    • Marked as answer by Anne Jing Friday, November 8, 2013 9:08 AM
    Thursday, November 7, 2013 12:22 PM