TEdit read-only background color in TPropertyPage
Borland's Object Windows Library for the modern age
Brought to you by:
jogybl,
sebas_ledesma
Hello,
a TEdit control with ES_READONLY (style set in rc file)
have the same background color as a normal (editable) TEdit control in TPropertyPage.
Disable the TEdit control does also not bring up the "old grey",
so the user can not see any diference to a editable control.
I noticed in Win7 all property pages are white.
In a normal TDialog the edit control shows grayed when readonly or disabled.
Any idea to get this working in property pages of a property sheet?
Greetings,
Skippy
Hi Skippy,
You can handle the WM_CTLCOLOR* message in the dialog to override standard colours.
That said, I recommend against it. I've found that in the long run it is better to go with the standard colour scheme as a rule of thumb.
In my experience, disabling an edit control usually means disabling its associated labels and buddy controls (such as Up-Down controls), so there still is a visual indication that the field is disabled. Also, the text colour turns grey for disabled edit controls. Here is an example:
(*) Note that the Win16 WM_CTLCOLOR message is obsolete and has been replaced by more specific messages, such as WM_CTLCOLORSTATIC, which is the interesting message in this case. OWLNext 6.34 has no response table macros for the new messages. For backwards compatibility it simply forwards them by simulating the old WM_CTLCOLOR message. OWLNext 6.40 will have response table macros for the new messages.
Last edit: Vidar Hasfjord 2014-03-10
Hello Vidar,
In WinXP the edit control readonly looks the same on dialog and on property page.
In Win7, Microsoft decided to make the property pages with white backgraund color and so the edit readonly gets white and shows no difference to a editable edit (Thanks Microsoft :-(
I use the edit control readonly to show calculated numbers on dialogs and on property pages.
With readonly style the user could see immediately which edits are for input and which are showing results.
What is good GUI design for property pages? To use static controls for calculated values?
Is it possible to make a TPropertyPageEx/TPropertySheetEx with gray background from which I can derive my pages/sheets? How?
I googled and found the MFC guys have the same problem; there was no solution on the net.
Greetings,
Skippy
That sounds like the way to go. After all, that is more in line with the intentions of the controls. Also, my advice is to design your GUI in a standard way so that it works well with Control Panel customisations of the UI appearance, especially the accessibility themes, such as high contrast. Do not assume the user uses the same theme as you.
See my previous reply.