if message=WM_CTLCOLOREDIT Then
HDC hdcChild=(HDC)wParam
Text is black – you can modify this by adding anothe '
variable for text color
((SetTextColor hdcChild,RGB(0,0,0
SetBkColor hdcChild, m_BackColor
End if
(OnSetFocus(pOldWnd
(m_BackColor=RGB(255,255,0
Invalidate FALSE
(OnKillFocus(pNewWnd
(m_BackColor=RGB(255,255,255
Force a repaint'
Invalidate FALSE
()OnPaint
(GetWindowText(m_Text
()SetBkGrndColor
Do not call for painting messages'
()SetBkGrndColor
Delete the old brush'
DeleteObject m_Brush
Create a new brush in the specified color'
(m_Brush=CreateSolidBrush(m_BackColor
(pDC=GetDC(handle
(SetBkMode pDC,OPAQUE
(SetBkColor pDC,m_BackColor
Select the brush into this window’s device context'
(SelectObject pDC,m_Brush
Dim rc As Rect
Get the client area of the edit control'
GetClientRect handle,rc
(ScreenToClient handle,rc
Rectangle pDC,0, 0, rc.Width, rc.Height
Rewrite the text since the backcolor paint overwrote'
the existing text
((SetTextColor pDC,RGB(0, 0, 0
TextOut pDC,2, 2, m_Text.GetBuffer,m_Text.GetLength