Recent

Author Topic: [SOLVED] Transparent Buttons  (Read 184 times)

Petrus Vorster

  • Sr. Member
  • ****
  • Posts: 254
[SOLVED] Transparent Buttons
« on: August 06, 2026, 03:07:44 pm »
Hi All

I saw a few discussions on the forum, but no real practical answer.

I am in need of a transparent button that shows the Glyph and the Text much like on a Windows desktop.
Perhaps there is LPC package out there with such a control.

Its not critical, but it would be nice.
I am busy building a launcher to bring everything together and it loads the current Windows desktop image as a background. I think it will be cool if I could create a button that looks like a Windows desktop.

Any thoughts would be welcome.

-Peter
« Last Edit: August 06, 2026, 03:11:43 pm by Petrus Vorster »

Xenno

  • Full Member
  • ***
  • Posts: 155
    • BS Programs
Re: [SOLVED] Transparent Buttons
« Reply #1 on: August 06, 2026, 04:52:57 pm »
Has it [SOLVED]?

By the way, in Windows, we can do as below example code:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   BorderStyle := bsNone;
  4.  
  5.   Panel1.BevelOuter := bvNone;
  6.   Panel1.ParentColor := False;
  7.   Panel1.ControlStyle := Panel1.ControlStyle - [csOpaque] + [csParentBackground];
  8.  
  9.   Color := clFuchsia;
  10.  
  11.   SetWindowLong(Handle, GWL_EXSTYLE,
  12.       GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
  13.   SetLayeredWindowAttributes(Handle, ColorToRGB(clFuchsia), 0, LWA_COLORKEY);
  14. end;
  15.  
  16.  
  17. procedure TForm1.Image1Click(Sender: TObject);
  18. begin
  19.   ShowMessage('Hello, World!');
  20. end;
  21.  
  22.  
  23. procedure TForm1.btnExitClick(Sender: TObject);
  24. begin
  25.   Close;
  26. end;    

You may want to add hover effect and dragging feature.
Lazarus 4.6, Windows 10, https://www.youtube.com/@bsprograms
If I want to share, I give. If I want money, I sell. I don't set traps.

Petrus Vorster

  • Sr. Member
  • ****
  • Posts: 254
Re: [SOLVED] Transparent Buttons
« Reply #2 on: August 07, 2026, 10:05:53 am »
Thank you.

Let me go and try this.

I will let you know what happened.

-Peter

 

TinyPortal © 2005-2018