VC++,How to modify the BG Color of Dialog

Started by
1 comment, last by Colin Jeanne 16 years, 9 months ago
VC++,How to modify the BG Color of Dialog?
akira32 編程之家 Yahoohttp://tw.myblog.yahoo.com/akira32-akira32
Advertisement
Check for WM_ERASEBKGND (or OnEraseBkGnd if you're using MFC). You need to handle the message yourself.

In MFC there's a nice function called FillSolidRect. If you're using pure Win32 API you need to create a HBRUSH and do a DrawRect.

If you're using .NET the dialog will have a member for the background color which can simply be set.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Even easier is to handle WM_CTLCOLORDLG. Just return a handle to a brush.

This topic is closed to new replies.

Advertisement