Link to home
Start Free TrialLog in
Avatar of 966
966

asked on

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.
Avatar of ebob42
ebob42
Flag of Netherlands image

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
Avatar of Emmanuel PASQUIER
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

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)..
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)))
ASKER CERTIFIED SOLUTION
Avatar of ebob42
ebob42
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of 966
966

ASKER

i only have delphi 6, installing delphi 7 now to try it out, im so used to 6 now tho..  any ideas?
Avatar of 966

ASKER

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