Recent

Author Topic: How to change Page control and combobox color ?  (Read 1592 times)

Pong

  • Newbie
  • Posts: 6
How to change Page control and combobox color ?
« on: January 10, 2023, 02:51:20 am »
for example: Page control border color .
I am trying to create a simple component but I'm not sure use class(TCustomControl) or  class(Tcombobox) :'(
« Last Edit: January 10, 2023, 02:53:59 am by Pong »

Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: How to change Page control and combobox color ?
« Reply #1 on: January 10, 2023, 06:04:42 pm »
I am afraid - not at all.
My workaround are small images. You may add them to the tabs.

Just grab some 16 x 16 icons, add them to an TImageList.
This ImageList you link to the TPageControl.
After this you can select your images from within the Tabsheets.

Is quite nice, I got used to it.

Or you use one of the components around, which allow it. - I did not like one of them and forgot their names.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: How to change Page control and combobox color ?
« Reply #2 on: January 28, 2023, 02:33:57 pm »
Moderation note

All IRC related content has been removed from this thread.

Please to not re-add.
« Last Edit: January 28, 2023, 02:36:31 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: How to change Page control and combobox color ?
« Reply #3 on: January 28, 2023, 02:44:46 pm »
As hinted by Joanna (by-product in one of the moderated IRC posts), it may be possible with "OwnerDrawn". However, no details have been posted on this.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: How to change Page control and combobox color ?
« Reply #4 on: January 28, 2023, 03:51:36 pm »
Hi!

TPageControl is based on TWinControl.

TWinControl owns no Canvas.

So you have to add a Canvas.

Winni

Joanna

  • Hero Member
  • *****
  • Posts: 755
Re: How to change Page control and combobox color ?
« Reply #5 on: January 28, 2023, 11:12:52 pm »
How would you add a canvas to tpagecontrol?
Another option is using tcdpagecontrol in custom drawn controls package
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: How to change Page control and combobox color ?
« Reply #6 on: January 29, 2023, 02:56:32 pm »
How would you add a canvas to tpagecontrol?
Another option is using tcdpagecontrol in custom drawn controls package

Good morning, Joanna  :-*

You could try using a TControlCanvas
Create it, set the control and see what happens!

As for the TComboBox, that already allows you to owner draw it.
« Last Edit: January 29, 2023, 02:58:12 pm by jamie »
The only true wisdom is knowing you know nothing

Joanna

  • Hero Member
  • *****
  • Posts: 755
Re: How to change Page control and combobox color ?
« Reply #7 on: January 29, 2023, 11:39:53 pm »
Hello Jamie  :), long time no see..
I’ve never heard of tcontrolcanvas before,  I’ll try it out Thanks.

Update I tried it out but wasn’t sure what do do with it ...
« Last Edit: January 31, 2023, 02:32:19 pm by Joanna »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018