, , ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

TabControl background color (OpenInsight 32-Bit)

At 17 JUN 2009 02:16:02AM Colin Rule wrote:

I am setting a form background colour in code.

When I set a tabcontrol to the same colour, it remains grey.

Is there a way to set the tab control background.

Using OI 8.0.8.


At 17 JUN 2009 11:40AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Colin,

Is yout app running with visual styles enabled?

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 17 JUN 2009 12:23PM Dale Jessop wrote:

Do you mean the actual tabs remain gray not the tab area?


At 17 JUN 2009 10:45PM Colin Rule wrote:

"Is your app running with visual styles enabled?"

Not sure what this actuall means.

In Form Designer, Properties, Windows, I have Background color check box set to ON.

In Form Designer, Properties, System Colour.

I have tried seetting all of the first three selections.

Code example

@@WINDOW-]BACKCOLOR=255
.TABCONTROL-]BACKCOLOR=255

I am using the standard Windows XP theme, although it does say 'Modified Theme' as I have changed the background on the desktop.

Please advise if there is something else I dont know about with respect to enabling visual styles.

Thanks


At 17 JUN 2009 10:47PM Colin Rule wrote:

The actual tabs are OK.

It is the area to the right of the tab up to the end of the control which are still grey.


At 18 JUN 2009 06:42AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Colin,

Visual Styles == Default XP Theme. It's the MS terminology for it. I was just checking that you weren't running in Windows Classic or had themes turned off for OI by removing the manifest file.

The MS tab control is a strange beast, and it's always seemed as though MS left it half finished when they introduced visual styles with XP - just try putting your tabs on the sides or bottom for example…

Here's the results I get for Vista and XP:

Windows Classic:

OI8: Tab background == form background (but tab rendering is a bit suspect)

OI9: Tab background is grey

Visual Styles enabled:

OI8: Tab background is grey

OI9: Tab background == form background and tab rendering is as expected)

Bear in mind that there was a big change in the underlying painting routines between OI 8 and 9 to support transparency and controls overlaying one another, though it looks like more work could be done in 9 to get the background correct in Classic mode as well (The messages between the classic and themed version of the controls are usually different)

If you're staying with 8.x for the time being you could try turning off the visual style for a particular control using the Windows API - we docced this in an old SENL, but because we're a tad busy it's not up on the new website yet - let us know if you need a copy and we'll send you one.

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 18 JUN 2009 06:48PM Colin Rule wrote:

Yes please, can I have the explantion of turning off the style.

Not sure if it will work for me, as I do want to be able to set the background to be the same as the user selected colour, but I am happy to try anything.


At 18 JUN 2009 11:31PM Colin Rule wrote:

Dont worry abount sending this SENL, Barry Stevens kindly sent me one.

I had a look, renamed the manifest file, re-started the application, and the background is OK.

The problem then is that all my controls do not use the visual styles, so I renamed the manifest file back to what it should be.

I then declared the DLL, and ran it, and hey presto, my background is as I would like it to me. woohooo….

The only down side is that this tab control is different from all the rest within the application, but this is much better than having a different colour background.

And as this tab is not quite used in the normal way (just one page in my form, with swapped visible controls), it does not matter.

Well done Sprezz.

View this thread on the Works forum...