Recent

Author Topic: Change button background color  (Read 3818 times)

dodgebros

  • Full Member
  • ***
  • Posts: 169
Re: Change button background color
« Reply #15 on: June 26, 2024, 05:56:47 am »
Thanks to all for trying to help.  In the end, I added a panel to my main form, then I added another panel to that panel, one for each button.  I used the MouseEnter and the MouseLeace events to mimic the look of a button and of course the onClick event to run additional code.  Please see the attached
picture.

TD

cdbc

  • Hero Member
  • *****
  • Posts: 2522
    • http://www.cdbc.dk
Re: Change button background color
« Reply #16 on: June 26, 2024, 10:02:40 am »
Hi
Yup, "Easy Peasy" right  :D
Good on you mate  8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

LBoxPO

  • New Member
  • *
  • Posts: 15
Re: Change button background color
« Reply #17 on: September 17, 2024, 12:24:05 am »
Thanks to all for trying to help.  In the end, I added a panel to my main form, then I added another panel to that panel, one for each button.  I used the MouseEnter and the MouseLeace events to mimic the look of a button and of course the onClick event to run additional code.  Please see the attached
picture.

TD

But what if you need buttons with rounded corners?  :)

Joanna

  • Hero Member
  • *****
  • Posts: 1400
Re: Change button background color
« Reply #18 on: September 17, 2024, 03:56:17 am »
This is easy just use tcdbutton from customdrawncontrols

dbannon

  • Hero Member
  • *****
  • Posts: 3612
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Change button background color
« Reply #19 on: September 17, 2024, 09:34:30 am »
An approach I used is to use TBitButton and fill it with a suitable sized bitmap. Displayed text is in the bitmap too of course. Does not scale....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018