-
Jun 4th, 2019, 10:26 AM
#1
Thread Starter
Addicted Member
[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
-
Jun 4th, 2019, 01:42 PM
#2
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.
-
Jun 4th, 2019, 02:11 PM
#3
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.
-
Jun 4th, 2019, 08:45 PM
#4
Thread Starter
Addicted Member
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 ?
-
Jun 4th, 2019, 08:46 PM
#5
Thread Starter
Addicted Member
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 ?
-
Jun 4th, 2019, 11:41 PM
#6
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.
-
Jun 5th, 2019, 08:15 AM
#7
Thread Starter
Addicted Member
Re: Grid showing normal on Windows XP, but black cell on Windows 10
yes, thank you. that is the down side of windows 10,
-
Jun 5th, 2019, 08:42 AM
#8
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).
-
Jun 5th, 2019, 09:00 AM
#9
Thread Starter
Addicted Member
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 ?
-
Jun 5th, 2019, 09:26 AM
#10
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/
-
Jun 5th, 2019, 09:32 AM
#11
Fanatic Member
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?
-
Jun 5th, 2019, 09:32 AM
#12
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.
-
Jun 5th, 2019, 09:49 AM
#13
Thread Starter
Addicted Member
Re: Grid showing normal on Windows XP, but black cell on Windows 10
this is the screenshot,
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
-
Jun 5th, 2019, 09:50 AM
#14
Thread Starter
Addicted Member
Re: Grid showing normal on Windows XP, but black cell on Windows 10
this is the screenshot,
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
-
Jun 5th, 2019, 09:50 AM
#15
Thread Starter
Addicted Member
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
-
Jun 5th, 2019, 09:54 AM
#16
Thread Starter
Addicted Member
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,
-
Jun 5th, 2019, 09:55 AM
#17
Fanatic Member
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
-
Jun 5th, 2019, 10:00 AM
#18
Thread Starter
Addicted Member
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,
-
Jun 5th, 2019, 10:02 AM
#19
Thread Starter
Addicted Member
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
-
Jun 5th, 2019, 10:06 AM
#20
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|