The effect is to show the edit box is "active" in some way (control
will not have focus). So when the border is off, it will look like a
normal edit control; when the border is on, user will see the text
within a colored box (inside the normal border of the edit control).
Are you talking about the background color? If so, see SetBkColor().
It is not practical to put a border inside an edit control. You can
change the control's background color, or you can paint a border
outside the control, or you can put a CStatic under the control and
change its visibility on/off.
I suppose you'd have to use some kind of owner draw.
What I ended up doing (and what worked) was putting a static control, owner-drawn, around
the edit control, and drawing it as either entirely in the dialog color (COLOR_3DFACE) or
in the desired highlight color (I was using red to indicate required fields that were not
filled in, for example).
In my validating edit control, I used background color to indicate completeness of a
value; even managing background color took a lot of work to force the edit control to
cooperate.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
You need to have the correct z-axis position (note that prior to the VS .NET versions, the
z-axis specified in the dialog editor was inverted from the correct z-axis), and you
really should have the WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles set for your dialog. But
it does work, and I've done it, and drawing order, over which you have no control anyway,
doesn't matter.
joe
For demonstrating that it works, I hand-calculated the bitmap size,
but it could be done dynamically.
The only drawback with this method is that the border can only be 1
pixel wide to maintain separation from the text background. I'm using
a normal edit control, not rich edit, in which I would have more
control over the margins.