在c++, Windows Store Metro应用程序中设置控件的颜色

Set the color of a control in C++, Windows Store Metro App

本文关键字:设置 控件 颜色 应用程序 Metro c++ Windows Store      更新时间:2023-10-16

我正在制作一个Windows Store Metro应用程序,我有一些问题…

我想在c++中设置控件的颜色,但是我不知道怎么做。

我现在有以下代码:

txt1->Background = ?

我有解决方案,首先创建一个画笔对象,设置颜色并将该颜色分配给控件背景。我使用了以下语句:

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

链接到我的问题:如何在windows 8商店应用程序中设置控件的背景色