【问题标题】:Set the color of a control in C++, Windows Store Metro App在 C++、Windows Store Metro App 中设置控件的颜色
【发布时间】:2016-01-02 03:36:12
【问题描述】:

我正在制作一个 Windows Store Metro 应用程序,但我遇到了一些问题..

我想在 C++ 中设置控件的颜色,但我不知道该怎么做..

我现在有以下代码:

txt1->背景=?

【问题讨论】:

  • 您是要标记这个 C++/CLI 还是 C++?
  • 它是 C++。我们正在制作一个 WIndows Store Metro 应用程序

标签: c++ windows colors microsoft-metro


【解决方案1】:

我有解决方案,首先制作一个画笔对象并设置颜色并将该颜色分配给您的控件背景。我使用了以下内容:

SolidColorBrush^ myBrush = ref new SolidColorBrush(Windows::UI::Colors::Red);
TextBox^ txtID = ref new TextBox();
txtID->Background = myBrush;

链接到我的问题:How to set a background color of a control in windows 8 store application

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-10
    • 1970-01-01
    相关资源
    最近更新 更多