اضافة button عن طريق button
#4
تفضل اخي
كود :
unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; // النموذج type TMainform = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } Procedure ButtonAction(Sender: TObject); public { Public declarations } end; var Mainform: TMainform; Btn: TButton; implementation {$R *.dfm} // معلومات الزر procedure TMainform.Button1Click(Sender: TObject); begin Btn := TButton.Create(Self); Btn.Parent := Self; Btn.OnClick := ButtonAction; Btn.Caption := 'zte-usb'; Btn.Width := 80; Btn.Left := 50; Btn.Top := 50; Btn.Height := 25; Btn.Visible := True; end; procedure TMainform.Button2Click(Sender: TObject); begin If Btn <> nil then Btn.Free; end; // حدث الزر المتكون procedure TMainform.ButtonAction(Sender: TObject); begin MessageBox(Handle, 'zte-usb Delphi4arab', 'Test', $40); AnimateWindow(Handle, 400, AW_HIDE or AW_BLEND); Close; end; procedure TMainform.FormDestroy(Sender: TObject); begin Btn.Free; end; end.
الرد


الردود في هذا الموضوع
اضافة button عن طريق button - بواسطة o.akhras1993 - 20-03-2014, 04:19 AM
اضافة button عن طريق button - بواسطة sadwolf - 20-03-2014, 08:17 PM
اضافة button عن طريق button - بواسطة S.FATEH - 20-03-2014, 08:37 PM
اضافة button عن طريق button - بواسطة zte-usb - 22-03-2014, 03:05 PM
اضافة button عن طريق button - بواسطة o.akhras1993 - 24-03-2014, 05:00 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم