Forum > Other

Make form or window transparent and keep all the control visible

(1/3) > >>

Awesome Programmer:
Hi,

Using latest Lazarus and fpc on LINUX operating system.

I want to make my form or window TRANSPARENT and all the controls like TLabel VISIBLE.

I found the solution to make the window TRANSPARENT by using the following code.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Form1.AlphaBlend:=true;Form1.AlphaBlendValue:=0;
But this code completely makes EVERYTHING on the Window and Window itself TRANSPARENT.

I ONLY want the form or window to be TRANSPARENT.

I have gone through ton of related questions and postings on this subject on this forum and all over the internet. None of the suggested solution I found seems to work or I may have missed the answer I am looking for.

Anyone have any idea? If not, could someone please point me in the right direction. Thanks. :)

KodeZwerg:
I just know a solution for Windows that does do what you wrote.
Since I do not know what Linux can and can not, there are 2 simple ways how you can reach your goal.
Method 1: you can give your form a special shape (cut out unwanted parts)
Method 2: you can create each element as its own form

Awesome Programmer:

--- Quote from: KodeZwerg on November 02, 2023, 10:07:51 am ---I just know a solution for Windows that does do what you wrote.
Since I do not know what Linux can and can not, there are 2 simple ways how you can reach your goal.
Method 1: you can give your form a special shape (cut out unwanted parts)
Method 2: you can create each element as its own form

--- End quote ---

Essentially, what I want to do is display a TLabel with Transparent form or window. Can it be done? I don't work how I do it or what I use to reach my goal. Just as long as it produces the desired effect that I am looking for.

Awesome Programmer:

--- Quote from: KodeZwerg on November 02, 2023, 10:07:51 am ---I just know a solution for Windows that does do what you wrote.
Since I do not know what Linux can and can not, there are 2 simple ways how you can reach your goal.
Method 1: you can give your form a special shape (cut out unwanted parts)
Method 2: you can create each element as its own form

--- End quote ---

How would you achieve Method 1?

Marc:

--- Quote from: Awesome Programmer on November 03, 2023, 03:30:07 pm ---How would you achieve Method 1?

--- End quote ---

Have a peek at SetWindowRgn and how to create a rgn

Marc

Navigation

[0] Message Index

[#] Next page

Go to full version