Recent

Author Topic: To change TPageControl color  (Read 14117 times)

asdf

  • Sr. Member
  • ****
  • Posts: 310
To change TPageControl color
« on: October 26, 2010, 04:06:23 am »
It is too bright in white color.
How could I write the code to change to another color?
Lazarus 1.2.4 / Win 32 / THAILAND

ivan17

  • Full Member
  • ***
  • Posts: 173
Re: To change TPageControl color
« Reply #1 on: October 26, 2010, 06:02:53 pm »
you shouldn't touch it.  if you have a problem with your theme, find a theme you like.

because of themes, tabsheets are NOT too bright on my system, and even darker on my aunt's system.  do not assume we are all using same theme you are and don't fix thing that aren't broken.

sabrespectre

  • Newbie
  • Posts: 3
Re: To change TPageControl color
« Reply #2 on: October 27, 2010, 12:53:22 am »
In Delphi I use OwnerDraw Property to True to use the TPageControl.OnPaint event.
In Lazarus there's no such option.
Some OS (Win7 Start) you can't even change the background, so changing color is necessary for a better view.

ivan17

  • Full Member
  • ***
  • Posts: 173
Re: To change TPageControl color
« Reply #3 on: October 27, 2010, 06:20:34 am »
Some OS (Win7 Start) you can't even change the background, so changing color is necessary for a better view.
on YOUR system.  tabsheets they are gray on my system and match tab header nicely.

that's because the theme engine does the drawing and i like the theme i'm using.

what i'm trying to tell you here is that nobody will like the appearance of the window where you changed ONE color and let the system draw the rest in its colors (which vary between users). either skin it COMPLETELY (like winamp) or leave everything to the theme engine.

sabrespectre

  • Newbie
  • Posts: 3
Re: To change TPageControl color
« Reply #4 on: October 27, 2010, 11:21:06 am »
It's not only in my system. I work in a workgroup of 45 pcs with Win7 Start and this OS there's few themes.
Plus, i like to color my sheets to user see the difference of importants tabs.
Since this existe on Delphi, it's not impossible to make in lazarus. I read some time ago that's there no such option because portability.

ivan17

  • Full Member
  • ***
  • Posts: 173
Re: To change TPageControl color
« Reply #5 on: October 27, 2010, 05:32:05 pm »
simple solution: put a panel or shape on a tabsheet (you can color them); buttons  and stuff on top of them...

(if it flickers too much, let us know and i'll whip up a complicated solution)

asdf

  • Sr. Member
  • ****
  • Posts: 310
Re: To change TPageControl color
« Reply #6 on: November 19, 2010, 07:19:34 am »
I prefer TPanel.
if it's on TTabsheet, how could we change TPanel color ?
Lazarus 1.2.4 / Win 32 / THAILAND

ivan17

  • Full Member
  • ***
  • Posts: 173
Re: To change TPageControl color
« Reply #7 on: November 19, 2010, 02:29:00 pm »
for panel, it's the super-secret Color property; change it in object inspector (thingy on the left part of the screen). also set borders to none and align to client.

if panel refuses to cooperate, put a shape and use its Brush.Color

 

TinyPortal © 2005-2018