- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working on Dialog based application. How can I change the background and text colors within EditBox. Unfortunately I can?t use modul Xflogm created by Jugoslav because I need e.g. Dlg_changesize too. Could somebody send me the short strip of the code?
Thanks a lot, Lada.
Thanks a lot, Lada.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You mean DLG_SIZECHANGE? I totally missed that one. I could add it to XFLOGM, but you'll have to wait for it for a couple of days.
Other than that, your only option is to subclass the dialog and handle WM_CTLCOLOREDIT yourself (this message is sent when an edit controls "asks" the dialog what colors to use). MenuDialog sample on my home page shows how to subclass the dialog (albeit for a different purpose). The subclassing code should be along these lines (written ad-hoc; check out the WM_CTLCOLOR* handling in XFLOGM for comparison -- it's slightly more complicated, as it may call DefWindowProc to retrieve default colors if user-defined are absent):
Other than that, your only option is to subclass the dialog and handle WM_CTLCOLOREDIT yourself (this message is sent when an edit controls "asks" the dialog what colors to use). MenuDialog sample on my home page shows how to subclass the dialog (albeit for a different purpose). The subclassing code should be along these lines (written ad-hoc; check out the WM_CTLCOLOR* handling in XFLOGM for comparison -- it's slightly more complicated, as it may call DefWindowProc to retrieve default colors if user-defined are absent):
integer, save:: hBrush =0
...
case(WM_CTLCOLOREDIT)
if (hBrush == 0) &
hBrush = CreateSolidBrush(#00FFFFF) !yellow
if (lParam == GetDlgItem(hDlg, IDC_YOUREDITBOX)) then
call SetTextColor(wParam, #FF0000) !blue
call SetBkMode(wParam, TRANSPARENT)
DlgProc = hBrush
end if
case(WM_DESTROY)
call DeleteObject(hBrush)
DlgProc = CallWindowProc(...)
case default
DlgProc = CallWindowProc(...)
end selectJugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks you, Jugoslav for your reply. Of course, I thought DLG_SIZECHANGE, excuse me for this mistake. I looked through your sample MenuDialog and try to use it similarly. It is really not quite easy, Ill be wait for your new version Xflogm too. (You needt be in a hurry it could take couple of weeks I will be patient.)
Lada.
Lada.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page