Grab/Get/Use MDI Background Color

R

Rick A

I may be kicking a dead horse but is there a way to find out what the
background color is that is being displayed? I'm talking about the
background color that you see when Access is running and there is nothing
else displayed but the database window. You know, the big blank area.

I've tried...
setting the back color for a form to "vbApplicationWorkspace" but this is
not the color of the background. It is a background color but for the part
behind the working space for the form. Open a form and look at the area
outside of the actual form, that's the background color represented by
"vbApplicationWorkspace".

I've looked at Stephen Lebans code "ChangeMDIBackGround" and it's sweet.
But I do not want to change the background, that's an individual choice. I
want to instead grab the color and use it. If I can set it, perhaps I can
grab it. But how?

My goal is to display a splash screen with the detail section of the screen
set to the exact same color as the background. That way it will look
transparent and as if it is part of the background. I've looked at placing
an image on the background and can go that way but would rather not since it
added additional size to an already large file.

Has anybody found a way?
 
D

Douglas J Steele

Are you aware that there are defined constants for system colours? I can't
find an online reference to point you to, but here's what I copied from the
Help file:


Screen element Value
Scroll bar -2147483648
Desktop -2147483647
Active window title bar -2147483646
Inactive window title bar -2147483645
Menu bar -2147483644
Window -2147483643
Window frame -2147483642
Menu text -2147483641
Window text -2147483640
Title bar text -2147483639
Active window border -2147483638
Inactive window border -2147483637
Application background -2147483636
Highlight -2147483635
Highlight text -2147483634
3-D face -2147483633
3-D shadow -2147483632
Dimmed (disabled) text -2147483631
Button text -2147483630
Inactive window title bar text -2147483629
3-D highlight -2147483628
3-D dark shadow -2147483627
3-D light -2147483626
ToolTip text -2147483625
ToolTip background -2147483624

Might Application background (-2147483636) be the colour for which you're
looking?
 
R

Rick A

Douglas,

I am aware of these. I've tried each one and could not find one that made
the detail section of the form the same color as the Access "background".

I thought Application Background would do the trick but my testing did not
indicate that this was the solution. I tried setting the application
background in the advanced appearance dialog box (right click on the
desktop, select properties, select the appearance tab, and select advanced)
thinking that might work. After I made the change I looked at Access and
Word to see if the "background" changed to the color I selected, bright
green. It did not. I then changed the color scheme to Olive Green (on the
appearance tab) to see what would happen. The background for Access and
Word changed to an olive green sort of color. I want to grab that color as
the color for the form. vbApplicationBackground and color scheme seem to be
mutually exclusive. Does one of the controls below map to the color scheme
I set? I think that is a clue.

I'm currently using Windows XP and Access 2003.

--
Rick Allison
Douglas J Steele said:
Are you aware that there are defined constants for system colours? I can't
find an online reference to point you to, but here's what I copied from
the
Help file:


Screen element Value
Scroll bar -2147483648
Desktop -2147483647
Active window title bar -2147483646
Inactive window title bar -2147483645
Menu bar -2147483644
Window -2147483643
Window frame -2147483642
Menu text -2147483641
Window text -2147483640
Title bar text -2147483639
Active window border -2147483638
Inactive window border -2147483637
Application background -2147483636
Highlight -2147483635
Highlight text -2147483634
3-D face -2147483633
3-D shadow -2147483632
Dimmed (disabled) text -2147483631
Button text -2147483630
Inactive window title bar text -2147483629
3-D highlight -2147483628
3-D dark shadow -2147483627
3-D light -2147483626
ToolTip text -2147483625
ToolTip background -2147483624

Might Application background (-2147483636) be the colour for which you're
looking?
 
D

Douglas J. Steele

I'm sorry, I don't know.

I know there's an API call that will let you determine the colour for a
particular pixel on the screen, but I can't find the details for it right
now. You could try posting to microsoft.public.vb.winapi

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Rick A said:
Douglas,

I am aware of these. I've tried each one and could not find one that made
the detail section of the form the same color as the Access "background".

I thought Application Background would do the trick but my testing did not
indicate that this was the solution. I tried setting the application
background in the advanced appearance dialog box (right click on the
desktop, select properties, select the appearance tab, and select
advanced) thinking that might work. After I made the change I looked at
Access and Word to see if the "background" changed to the color I
selected, bright green. It did not. I then changed the color scheme to
Olive Green (on the appearance tab) to see what would happen. The
background for Access and Word changed to an olive green sort of color. I
want to grab that color as the color for the form.
vbApplicationBackground and color scheme seem to be mutually exclusive.
Does one of the controls below map to the color scheme I set? I think
that is a clue.

I'm currently using Windows XP and Access 2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top