09-23-2017, 05:15 PM
When I have an colored background in an editfield, the text within that editfield becomes unreadable when it is being modified.
Example, put cursor somewhere within the asterisk and edit/modify the text.
Function tst_backgr
EDIT:
Is there a redraw that must be done to avoid unreadable text?
Example, put cursor somewhere within the asterisk and edit/modify the text.
Function tst_backgr
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Edit 0x54231044 0x200 32 19 152 87 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""
str controls = "3"
str e3="AAAA***AAAA"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
int textcolor=0x000000
int backcolor=0x00ffff
int-- hbrush
sel message
,case WM_INITDIALOG
,,hbrush=CreateSolidBrush(backcolor)
,case WM_DESTROY
,case WM_DESTROY
,,DeleteObject hbrush
,case WM_CTLCOLOREDIT
,,if(lParam=id(3 hDlg))
,,,SetTextColor wParam textcolor ;;text
,,,SetBkMode wParam TRANSPARENT
,,,ret hbrush ;;background
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
EDIT:
Is there a redraw that must be done to avoid unreadable text?