Results 1 to 20 of 20

Thread: [RESOLVED] Grid showing normal on Windows XP, but black cell on Windows 10

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Resolved [RESOLVED] Grid showing normal on Windows XP, but black cell on Windows 10

    Hi gurus,

    I don't know how to resolve this, I tried every way.
    My client have this program built in old times when Windows XP was common used (around 15 years ago).
    Now my client upgrade his computer and only support Windows 7/10. But now problem occurs, the grid usually show white background cell, now shown black in Windows 10-64 bit.
    I tried every single way I can think of :
    1. upgrade the dbgrid32.ocx to newest one.
    2. change my windows 10 themes to disable Peek.
    3. set compatibility in application for windows xp (resolution 640x480, bla bla bla)

    and nothing can help, always the grid shows black cell inside grid.

    anyone can help, thanks

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    Most likely theme related.
    If you have the source code check and see what the background of the grid is set to, most likely it is using a color from a theme and that color is different on the active theme in windows 10. As a general rule cells should use the window background color which should be white on every version of the OS in their default themes.

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    It would help to know more details, such as theme settings as already mentioned. Even better: a small demo program's Project source files zipped that can reproduce the problem under the same conditions.

    This sort of thing will probably be a bigger problem in the near future. Newer versions of Windows 10 are expanding the use of "dark mode" features and this will probably get used more often than the low-vision Accessibility themes. I expect to see a lot of future whinging from programmers who break the rules on color use without a care. The "pastel clown wig" applications will probably be hit the hardest, followed by more elaborate general skinners who often make assumptions about foreground colors all being black by default for many controls. We'll all probably get burned here and there.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    thanks for your feedback, i don't have the source code, the grid color must somehow change to "some" color while developed under Windows XP. And I google, the only way to make it normal like in Windows XP , you can change your windows theme to classic mode and this classic mode only can be applied in Windows 7. I can't find classic theme on Windows 10.

    Anyone can help ?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    thanks for your feedback, i don't have the source code, the grid color must somehow change to "some" color while developed under Windows XP. And I google, the only way to make it normal like in Windows XP , you can change your windows theme to classic mode and this classic mode only can be applied in Windows 7. I can't find classic theme on Windows 10.

    Anyone can help ?

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    Yes classic theme can often be the cure but not when using Windows 10. If you do not have the source then the only thing I can think of is to try different themes and see if any of them work for you.

    The grid color when developed under XP or any other OS would default to window background color which is by default white.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    yes, thank you. that is the down side of windows 10,

  8. #8
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    One difference between earlier themes and Windows 10 themes is that the older ('Classic') themes normally have the Titlebar text in White, newer themes use Black.
    If the Grid has its background color (incorrectly) set to the Active Title Bar Text color it would be white with a Classic theme but black with most newer themes.
    To check/fix this, find a theme with white Title Bar text.
    (You could try switching on the High Contrast White theme in Windows 10 to check this, though if this solves the issue you may prefer to find a better, non-high contrast, theme).

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    thank you, i think i already tried high contrast theme on windows 10, but still the grid shown in black cell, but never try the title bar color. I even tried to emulate windows xp by installing freeware skin, but still same problem. But I never try change the theme color on Windows 10 by selecting manual object such as title bar, textbox, etc. Is that possible on Windows 10 ?

  10. #10
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    I haven't fooled with the themes much on 10 but overall the options appear much more limited than on previous versions.
    It would likely be a simple fix if you had the code but without it you are down to hit and miss. Just go into the settings on the PC and try different themes and/or theme options and maybe you will find one that gives the results you want.

    Here is something I found online. I have not tried it but you may want to take a look
    https://www.howtogeek.com/133405/how...-on-windows-8/

  11. #11
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    706

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    I just checked the default colors in the control, which is Microsoft Data Bound Grid Control - DBGRID32.OCX(Listed in MSDN Index as "DataGrid Control"), and they are set as follows:

    BackColor: Window Background
    ForeColor: Window Text

    Both are system colors. There are no other color properties for the control. So if the back color appears white on older OS'es with default themes, then the cause is something else. I have heard of issues when controls placed on frames, but I am not sure if this is the case. Can you provide a screenshot? Can you tell if the DataGrid Control is placed on the form directly, or on top of something else, like frames or tabs?

  12. #12
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    When you said you tried the high contrast theme, did you try 'High Contrast White' (not the default High Contrast Black).

    The assumption is that the grid backcolor is set to an incorrect System Color. It should have been 'Window Background' but appears not to be. My guess is that it is set to Active TitleBar Text by mistake. But it could be any of a number of others (such as button text).

    The difficulty is trying to work out what it is set to.

    You could try a utility to change individual system colors - this may work WinAero Tweaker https://winaero.com/
    It is possible to change colors in the Registry too.
    Remember though that changing individual colors affects all applications, so a fix for your application may affect a different application.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    this is the screenshot,
    Name:  Untitled.jpg
Views: 755
Size:  23.8 KB

    about high contrast white, i never know Windows 10 have other mode, but I will try to search for it, let you know if it work

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    this is the screenshot,
    Name:  Untitled.jpg
Views: 755
Size:  23.8 KB

    about high contrast white, i never know Windows 10 have other mode, but I will try to search for it, let you know if it work

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    and one thing, i like to add, the grid i think the developer used was msdatgrd.ocx

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    AND, GUESS WHAT ?? IT WORKED ...

    i just switched to high contrast white, and voila..thank you everyone, thank you very much,

    Name:  Untitled1.jpg
Views: 795
Size:  40.5 KB

  17. #17
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    706

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    It looks like the developer set RowDividerStyle, and Column.DividerStyle properties. The settings are:

    0 No divider
    1 Black line
    2 (Default) Dark gray line
    3 Raised
    4 Inset
    5 Divider is drawn using the ForeColor property setting color

  18. #18

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    AND, GUESS WHAT ?? IT WORKED ...

    i just switched to high contrast white, and voila..thank you everyone, thank you very much,

    Name:  Untitled1.jpg
Views: 795
Size:  40.5 KB

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Grid showing normal on Windows XP, but black cell on Windows 10

    the best when you inside a forum is when you meet a lot of contributors and they really help you, thank you guys. thank you gurus

  20. #20
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: [RESOLVED] Grid showing normal on Windows XP, but black cell on Windows 10

    iirc DBgrid32.ocx originated in VB5 (but can be used in VB6 of course). MSdatgrd.ocx is from VB6, but is similar to the older control. Both have a 'BackColor' property.

    Looking at your screenshot, it shows the TitleBar text as black - my guess is that this is where the black color is being picked up from (but it could be from somewhere else that is black, such as the button text).

    EDIT
    I've just seen your reply, good it is fixed
    Last edited by VB6 Programming; Jun 5th, 2019 at 10:09 AM. Reason: Update

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width