开发者

Will a pre-defined Brush follow changes in Windows color scheme?

Let's say I have the following code:

  Dim _Brush_Disabled As New SolidBrush(Color.FromKnownC开发者_如何学Color(KnownColor.GrayText))
  Dim _Brush_Enabled As New SolidBrush(Color.FromKnownColor(KnownColor.WindowText))

  Sub Do_Something()
    '
    ' ... _Brush_Disabled and _Brush_Enabled are repeatedly used in this sub
    '
  End Sub

Will _Brush_Disabled and _Brush_Enabled automatically change their colors if the Windows color scheme changes?

If not, how can I make them 'track' Windows color scheme changes?


No, it won't automatically update for you. You can listen for the WM_SYSCOLORCHANGE event on your main window (or where ever your brushes are defined) to know when to update.

More information can be found here and here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜