Recent

Author Topic: [SOLVED] Titlebar custom color  (Read 597 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 533
[SOLVED] Titlebar custom color
« on: November 30, 2023, 09:25:32 pm »
Hello, I have a question: is it possible to change the color of the form's title bar?
« Last Edit: December 01, 2023, 09:25:58 pm by Pe3s »

domasz

  • Sr. Member
  • ****
  • Posts: 434
Re: Titlebar custom color
« Reply #1 on: November 30, 2023, 09:31:14 pm »
I don't think so, but:

Code: Pascal  [Select][+][-]
  1. Panel1.Color := clRed;
  2. Panel1.Align := alTop;
  3. BorderStyle := bsNone;
« Last Edit: December 01, 2023, 02:34:51 pm by domasz »

DreamVB

  • Full Member
  • ***
  • Posts: 100
    • Memo Pad
Re: Titlebar custom color
« Reply #2 on: December 01, 2023, 01:08:13 pm »
The above answer is your best bet and also good for cross-platform if your on Windows you chould try subclassing the form then set your own drawing methods but this maybe a lot of work if your not to good with api stuff. as said the above answer is better I did find this as an extra on bing uses the same method as above but also gies code for moving the form with the panel.

https://www.bing.com/search?q=change+color+or+title+bar+lazarus&FORM=AWRE
Dream Believe Achieve

domasz

  • Sr. Member
  • ****
  • Posts: 434
Re: Titlebar custom color
« Reply #3 on: December 01, 2023, 02:38:50 pm »
In Windows this can be used to move a form:
https://www.swissdelphicenter.ch/en/showcode.php?id=417

Pe3s

  • Hero Member
  • *****
  • Posts: 533
Re: Titlebar custom color
« Reply #4 on: December 01, 2023, 09:25:41 pm »
Thank you for the discussions  :)

 

TinyPortal © 2005-2018