If the parent form of a (text) static control has a pattern on its background, then the area around the static control is an ugly blotch of solid color. How can I paint the background of the static control with the same pattern that its parent window uses?
I've tried this,
SetClassLong(retval , GCL_HBRBACKGROUND, (LONG)stripes);
where retval was an HWND, pointing to the static control I just created,
and stripes is an HBRUSH created from a bitmap. I tried with this, too:
SetClassLongPtr(retval , GCLP_HBRBACKGROUND, (LONG)stripes);
Neither of them worked. Does anyone know how to change the background of a static control in C?
Update
I handled the WM_CTLCOLORSTATIC
message, which worked to an extent--it filled up the empty space in all the labels with the pattern I wanted. But the color right behind the text was just white... How can I make the pattern fill up that space as well?
Nevermind, got it.
SetBkMode(hdc, TRANSPARENT);