Making forms become transparent

Hi experts,

procedure TForm1.Button1Click(Sender: TObject);
begin
form2.show;
end;


I want to make form2 transparent, so i can still see form 1 throught it. How ?

I have an image on form2 thats transparent, but i cant see through form2 to view form 1.
966Asked:
Who is Participating?
 
ebob42Connect With a Mentor Commented:
Indeed, that's why I suggested AlphaBlend. It's one of the least known features, but works on just about any version of Windows (even older ones like 98), and may be exactly what the original poster is looking for...
0
 
ebob42Commented:
Set AlphaBlend to True, and then give the AlphaBlendValue of the form you want to "look through" a value lower than 255 (but bigger than 1). Experiment for yourself for the best effect...

AlphaBlend := True;
AlphaBlendValue := 64; // for example
0
 
epasquierCommented:
AlphaBlend is for translucent form, and is available only in newest Delphi.

If what you want is to have some parts of the form transparent, but anything else opaque, you need to play with the window 'region'
a great example of what's possible and how to do it (even use a bitmap as definition of complex transparency shapes) is there :
http://www.hwb.com/gruhn/programming/tutorial/clear.html

0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
ebob42Commented:
No, Alphablend is *not* available in the newest Delphi. You're confused with GlassFrame (which only works on Vista or 7 with Aero enabled).

AlphaBlend exists in Delphi 7 and possibly even lower (but I do not have Delphi 6 or lower on my machine anymore)..
0
 
epasquierCommented:
True ! You'll excuse me I switch constantly between Delphi 5 & 7, sometime 2007 I am sometime confused with what is available with what version. And I effectively thought about GlassFrame.

AlphaBlend is not in Delphi 5, it most probably came with 7 (where I just checked it is available).

I never thought of using AlphaBlend, it must be cool combined with regions (thus making forms of any shape with translucency - perfect for a splash screen with animated fading :o)))
0
 
epasquierCommented:
I sincerely bow humbly before this piece of knowledge. Even if it's not what he's looking for, I thank you for bringing that to my attention.
0
 
966Author Commented:
i only have delphi 6, installing delphi 7 now to try it out, im so used to 6 now tho..  any ideas?
0
 
966Author Commented:
delphi 7 is the answer, i knew this already but thought id ask for a way to get delphi 6 to work with it before it finishes downloading. thanks guys anyway
0
All Courses

From novice to tech pro — start learning today.