@Mmarquee, an easy way to do this is to use Activeform , this is an ActiveX control that encapsulates a Delphi form, you can use the @Francois clause or the following approach, which makes it easy to deploy any standard form as an activex control.
First you need to create a new ActiveX control
then you add a new active form
Now you need to create a new standard form and place your component here.
Add the use of your standard form to the block where the TActiveForm
is located and declare a variable of your standard form this way
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ActiveX, AxCtrls, Project75_TLB, StdVcl, Form1; //your unit with the standard form type TActiveFormX = class(TActiveForm, IActiveFormX) private ... public MyForm : TForm1;
finally, in the oncreate ActiveForm event, you put the code to call the standard form and embed it in activeform.
procedure TActiveFormX.ActiveFormCreate(Sender: TObject); begin MyForm := TForm1.Create(Self); //set the owner MyForm.Parent := Self;//embed the form MyForm.Align := alClient; MyForm.BorderStyle := bsNone; //hide the border of the form MyForm.Visible := True;//makes the form visible end;
for more information check links to abstracts