Marco Web Center |
Home: Code Repository: Mastering Delphi 5Project CREATEC
Project StructureCREATEC.DPRprogram CreateC; uses Forms, CreateCF in 'CreateCF.pas' {Form1}; {$R *.RES} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. CREATECF.PASunit CreateCF; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} uses StdCtrls; procedure TForm1.FormMouseDown( Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var Btn: TButton; begin Btn := TButton.Create (Self); Btn.Parent := Self; Btn.Left := X; Btn.Top := Y; Btn.Width := Btn.Width + 50; Btn.Caption := Format ('Button at %d, %d', [X, Y]); end; end. CREATECF.DFMobject Form1: TForm1 Left = 230 Top = 109 Width = 353 Height = 306 Caption = 'Create Comp' Color = clBtnFace Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = True OnMouseDown = FormMouseDown PixelsPerInch = 96 TextHeight = 13 end
|
||
© Copyright Marco Cantù, 1995-2020, All rights reserved |