I'd like to keep this as clean as possible, so I derived my own class from
CEdit.
I overrode the WM_ERASEBKGND message, however I can't seem to get the DC for
the actual edit control. When I do a PatBlt it changes the color of the
toolbar, and not the edit control.
Any ideas?
Well, the EDIT WNDCLASS has the CS_PARENTDC style, so what
you say makes sense in that respect. Anyway, try handling
the WM_CTLCOLOREDIT or WM_CTLCOLOR/CTLCOLOR_EDIT message
in the parent or the reflected (=WM_CTLCOLOR) message in a
derived CEdit subclass.
--
Jeff Partch
>.
>
Maybe you or someone else knows what could be causing this..
My edit control has a spin control attached to it. It appears that no matter
what side it is attached on, about 1 line of pixels is being painted over by
the edit control. And when I lose focus from the edit control and the text
selection disappears, a second line of pixels is painted over by the edit
control.
I'm running Win XP and MFC 7.0-
My code to create the edit and spinner looks like this:
if (!m_wndEditDelay.Create(WS_TABSTOP | ES_NUMBER | ES_CENTER | WS_VISIBLE |
WS_CHILD,
rect, &m_wndToolBar, ID_EDIT_DELAY))
{
TRACE0("Failed to create Delay edit control.\n");
return -1;
}
if (!m_wndSpinDelay.Create(WS_CHILD | WS_VISIBLE | // dwStyle
UDS_ALIGNLEFT | UDS_SETBUDDYINT | UDS_ARROWKEYS,
rect, // rect
&m_wndToolBar, // CWnd* pParentWnd
ID_SPIN_DELAY)) // UINT nID))
{
TRACE0("Failed to create delay spin control.\n");
return -1; // fail to create
}
m_wndSpinDelay.SetBuddy(&m_wndEditDelay);
"Jeff Partch" <airb...@airmail.net> wrote in message
news:6ccb01c1ed46$c2fb5770$9ee62ecf@tkmsftngxa05...