Board index » delphi » Change Color of each Tab of PageControl

Change Color of each Tab of PageControl

Hello,

i need help for the following problem:
Using D4 i want to change the color of every Tab depending on a value i
get from a database.
For example:

        if Database.DateTimefield.Value < (Date -20) then
                "Tabs color should became red"

        If Database.DateTimefield.value < (date - 10) then
                "Tabs color should became yellow"
        If Database.DatetimeField.Value > Date then
                "Tabs color should become green"
        ans so on...

The Informations earlier discussed in this newsgroup always changed  the
color of the complete Pagecontrol.
I tried these Information but didn't have success.

Than you very much for your help.

Bye
Josef

 

Re:Change Color of each Tab of PageControl


Quote
> Using D4 i want to change the color of every Tab depending on a value i
> get from a database.

You have to draw the tab yourself in this case, using the OnDrawtab event.
Set the controls OwnerDraw property to true to get the event to fire.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Change Color of each Tab of PageControl


On Thu, 25 Nov 1999 23:38:53 +0100, "Peter Below (TeamB)"

Quote
<100113.1...@compuXXserve.com> wrote:
>> Using D4 i want to change the color of every Tab depending on a value i
>> get from a database.

>You have to draw the tab yourself in this case, using the OnDrawtab event.
>Set the controls OwnerDraw property to true to get the event to fire.

Peter I have done that but is there also
a way to allow for an accelerator key as well?

Frank

Frank Cowan

Low cost web hosting!
Delphi Friendly!
http://www.signaldataonline.net

Re:Change Color of each Tab of PageControl


In article <383e90c0.1853...@forums.borland.com>, Frank Cowan
wrote:

Quote
> Peter I have done that but is there also
> a way to allow for an accelerator key as well?

If you want to underline a character following an & you have to use
another text output function than Canvas.Textout. Use the API
function DrawText. Canvas.handle is the hDC to pass it. See
win32.hlp for details.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads