Is there an easier way to change the background color of an edit box than doing the owner draw routine?
Best Regards
Jim
-------------
Jim Seekamp
Best Regards
Jim
-------------
Jim Seekamp
#Compile Exe #Register None #Dim All #Include "Win32Api.Inc" %ID_Text = 201 CallBack Function DlgProc Static hBrush As Long Select Case CbMsg Case %WM_INITDIALOG: hBrush = CreateSolidBrush(%Yellow) Case %WM_DESTROY: DeleteObject hBrush Case %WM_CTLCOLOREDIT Select Case GetDlgCtrlId(CbLparam) Case %ID_Text SetTextColor CbWparam, %Red SetBkColor CbWparam, %Yellow Function = hBrush: Exit Function End Select End Select End Function Function PbMain Local hDlg As Long Dialog New 0, "",,, 200, 60 To hDlg Control Add TextBox, hDlg, %ID_Text,"", 5, 5, 190, 50, _ %ES_WANTRETURN Or %ES_MULTILINE, %WS_EX_CLIENTEDGE Dialog Show Modal hDlg Call DlgProc End Function
SetBkMode hEdit, %Transparent
If HiWrd(wParam) = %EN_CHANGE Then ' Cure multiline paint-problem RedrawWindow lParam, ByVal 0, 0, %RDW_ERASE Or _ %RDW_INVALIDATE End If
If hBrush&<>0 then ' set the colors else beep ' or messagebox to debug end if
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment