Static Control Background Color with C++

前端 未结 3 1496
我寻月下人不归
我寻月下人不归 2020-12-02 02:19

I am creating a basic GUI with the Windows API and I have run into an issue. It starts with a main window that opens with a custom background color I set (RGB(230,230

3条回答
  •  误落风尘
    2020-12-02 03:12

    I think there is a permanent way to do it.

    Just after you create the label,use GetDC() function to get the Device Context. Then use:

    SetTextColor(hdcStatic, RGB(0,0,0));
    SetBkColor(hdcStatic, RGB(230,230,230)); // Code Copied from the above answer by cpx.
    

    And it should do .

提交回复
热议问题