Get panel background color

Hi!

Is there any way to programmatically get the background color of a panel? Recently I have noticed that for example the default background color for panels in Windows XP and Windows 8 are different (well, in any case anyone can change the default colors in Windows). Since I put graphs on a panel as subwindows I would like to set the background color of the graphs to the same color the panel has. Until now I fixed the background color of the graphs to the color I found the panel has (under WinXP), but the same Panel looks terrible under Windows 8 for example.

Thanks for any hints and ideas!

Gregor
Maybe that is not what you want, but I guess the simplest solution would be to also set the panel color (via ModifyPanel cbRGB=(R,G,B)). This way you have control over both the graph and panel colors. It could as well be the same gray the panel usually has, but then the color will (hopefully) stay the same on different OSes.
Yes, this was the only idea that came to my mind too. It seems there is no way to get the default values, although if I understood the help files correctly they are written down in the Preferences on the disk ...

Thanks anyways!

Gregor
Quote:

ControlInfo [/W=winName ] kwBackgroundColor
... [sets] V_Red, V_Green, V_Blue.

If controlName is kwBackgroundColor then it is the color of the control panel background. This color is usually the default user interface background color, as set by the Appearance control panel on the Macintosh or by the Appearance tab of the Display Properties on Windows, until changed by ModifyPanel cbRGB.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Use a switch directive based on the return value of IgorInfo.

Function SetPanelBGC(rgb)
   wave rgb

   string osinfo = igorinfo(3)
   string ostype =    // ... parse osinfo string to get OSVERSION or OS ...
   switch(UpperStr(ossubtype))
     case "WINDOWS XP":
        rgb = ...
        break
     case "WINDOWS 8":
        rgb = ...
        break
    endswitch
    return 0
end


--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
JimProuty wrote:
Quote:

ControlInfo [/W=winName ] kwBackgroundColor
... [sets] V_Red, V_Green, V_Blue.

If controlName is kwBackgroundColor then it is the color of the control panel background. This color is usually the default user interface background color, as set by the Appearance control panel on the Macintosh or by the Appearance tab of the Display Properties on Windows, until changed by ModifyPanel cbRGB.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.


Thanks Jim! I would have never looked for the answer to this "issue" in the help of ControlInfo ... This helps me a lot!

Gregor