program Project6;
uses Vcl.Forms, Unit11 in 'Unit11.pas' {Form11}, Unit12 in 'Unit12.pas' {Frame12: TFrame};
{$R *.res}
begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm11, Form11); Application.Run; end. ////////////////////////////////////// unit Unit11;
interface
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinOffice2010Blue, dxSkinscxPCPainter, dxBarBuiltInMenu, cxPC, Unit12;
type TForm11 = class(TForm) pgControl: TcxPageControl; cxTabSheet1: TcxTabSheet; cxTabSheet2: TcxTabSheet; cxTabSheet3: TcxTabSheet; Frame121: TFrame12; private { Private declarations } public { Public declarations } end;
var Form11: TForm11;
implementation
{$R *.dfm}
end. ////////////////////////////////////// object Form11: TForm11 Left = 0 Top = 0 Caption = 'Form11' ClientHeight = 299 ClientWidth = 635 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object pgControl: TcxPageControl Left = 0 Top = 0 Width = 635 Height = 299 Align = alClient TabOrder = 0 Properties.ActivePage = cxTabSheet2 Properties.CustomButtons.Buttons = <> ClientRectBottom = 299 ClientRectRight = 635 ClientRectTop = 24 object cxTabSheet1: TcxTabSheet Caption = 'cxTabSheet1' ImageIndex = 0 end object cxTabSheet2: TcxTabSheet Caption = 'cxTabSheet2' ImageIndex = 1 inline Frame121: TFrame12 Left = 0 Top = 0 Width = 635 Height = 275 Align = alClient TabOrder = 0 inherited Button1: TButton Left = 32 Top = 48 end end end object cxTabSheet3: TcxTabSheet Caption = 'cxTabSheet3' ImageIndex = 2 end end end ////////////////////////////////////// unit Unit12;
interface
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinOffice2010Blue, dxSkinscxPCPainter, dxBarBuiltInMenu, cxPC;
type TFrame12 = class(TFrame) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
implementation
{$R *.dfm}
procedure TFrame12.Button1Click(Sender: TObject); var c : TComponent; begin with GetParentForm( Self ) do begin c := FindComponent( 'pgControl' ); if Assigned( c ) then if c is TcxPageControl then TcxPageControl( c ).ActivePage.Free; end; end;
end. ////////////////////////////////////// object Frame12: TFrame12 Left = 0 Top = 0 Width = 320 Height = 240 TabOrder = 0 object Button1: TButton Left = 112 Top = 104 Width = 75 Height = 25 Caption = 'Button1' TabOrder = 0 OnClick = Button1Click end end
|