Get default Windows System Colors in .NET

前端 未结 5 1763
闹比i
闹比i 2021-02-14 07:49

I\'m writing a custom Button control as part of a (soon to be) free Control suite, and I would like to base my (default) Control colors on the corresponding Windows System color

5条回答
  •  忘掉有多难
    2021-02-14 08:35

    I am wanting the same thing. My approach is to, upon initialization, create a temporary window with the background color specified in GetSysColor(COLOR_BTNFACE), the "standard" background color for dialog boxes. Then, I create a button with no text and get the colors. This temporary window is never displayed, and is destroyed immediately (WM_CREATE exit code = -1).

提交回复
热议问题