Link to home
Start Free TrialLog in
Avatar of ginsonic
ginsonicFlag for Romania

asked on

Embedded form

how can I create a Form vcl and when drop it in my main form to become a part of my main form ? An embedded form I think.

I wish to work as a panel but to derive from TForm and not from TPanel.


Sorry no more points :(
ASKER CERTIFIED SOLUTION
Avatar of geobul
geobul

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
Avatar of ginsonic

ASKER

I wish to add an alphablending to my vcl. so I intend to embedd a form and toplay with her alphablending values.
Avatar of atul_parmar
Change the parent of your sub form. e.g.
Windows.SetParent(MySubForm.Handle, MainForm.Handle);
Avatar of Radler
Radler

Without a complete knowledge of the problem I suggest use Frames. There a lot of advantages, by example the visual use of them.

T++, Radler.
I found on net that Delphi can embbed forms but nowhere how can I do this.
ginsonic,

Have you seen this before with another tool?

Frames behavior is like forms at design time, and based in your information the frame use is acceptable.

Any help about this approuch?

T++, Radler.
Can I set an alphablending just for this frame?
You rake a lot!


Copied from VCL, how provide a alpha blend.

procedure TCustomForm.SetLayeredAttribs;
const
  cUseAlpha: array [Boolean] of Integer = (0, LWA_ALPHA);
  cUseColorKey: array [Boolean] of Integer = (0, LWA_COLORKEY);
var
  AStyle: Integer;
begin
//  if not (csDesigning in ComponentState) and
//    (Assigned(SetLayeredWindowAttributes)) and HandleAllocated then
//  begin
    AStyle := GetWindowLong(Handle, GWL_EXSTYLE);
    if FAlphaBlend or FTransparentColor then
    begin
      if (AStyle and WS_EX_LAYERED) = 0 then
        SetWindowLong(Handle, GWL_EXSTYLE, AStyle or WS_EX_LAYERED);
      SetLayeredWindowAttributes(Handle, FTransparentColorValue, FAlphaBlendValue,
        cUseAlpha[FAlphaBlend] or cUseColorKey[FTransparentColor]);
    end
    else
    begin
      SetWindowLong(Handle, GWL_EXSTYLE, AStyle and not WS_EX_LAYERED);
      RedrawWindow(Handle, nil, 0, RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or RDW_ALLCHILDREN);
    end;
  end;
//end;


Without a test and how TFrame is a TScrollingWinControl descendent this is implementable. Maybe some extra effort required in code to set this attributes.

T++, Radler.
I have try with TFrame but still can't make it alphablended. Just the frame and not the main form.
Hi ginsonic,

I made a great effort to remember, but always record that I´ve posted the FIRST comment to this question. morever we follow a track to solve the alpha problem. To my surprise emerged from scratch a geobul answer whitout another comment about the alpha problem. Seams a joke but, have I made mad?

T++, Radler
First of all non of you don't answer to my question - embedded forms ??? This is my reason for a C. I just wish to close the topic but I don't get any answer.

Your alphablending don't work for frames. Sorry!