Menu

TEdit read-only background color in TPropertyPage

Skippy
2014-03-10
2014-03-10
  • Skippy

    Skippy - 2014-03-10

    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

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2014-03-10

    Hi Skippy,

    Any idea to get [grey background for disabled edit controls] in property pages of a property sheet?

    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.

    Disable the TEdit control does also not bring up the "old grey", so the user can not see any difference

    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:

    Disabled Edit control screenshot

    (*) 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
  • Skippy

    Skippy - 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

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2014-03-10

    I use the edit control readonly to show calculated numbers on dialogs and on property pages. [...] What is good GUI design for property pages? To use static controls for calculated values?

    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.

    Is it possible to make a TPropertyPageEx/TPropertySheetEx with gray background from which I can derive my pages/sheets? How?

    See my previous reply.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB