اضافة خاصية dblclick الىtbutton
#2
وعليكم السلام ورحمة الله

لا اعرف ان كان هناك شئ بدوال API او غيره يمكن تطبيق ذلك

ولكن دعني اعطيك فكرة

التايمر اجعل خاصية Interval=500 نصف ثانية فقط


كود :
unit Unit1; interface uses  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Buttons, Vcl.StdCtrls, Vcl.ExtCtrls; type  TForm1 = class(TForm)    btn1: TButton;    tmr1: TTimer;    procedure btn1Click(Sender: TObject);    procedure tmr1Timer(Sender: TObject);  private    { Private declarations }  public    { Public declarations }  end; var  Form1: TForm1;  int:Integer; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject); begin  int:=int+1;  tmr1.Enabled:=True;  Self.Text:=Int.ToString() ; end; procedure TForm1.tmr1Timer(Sender: TObject); begin if int=1 then begin int:=0; tmr1.Enabled:=False;  Self.Text:=Int.ToString() ; end; if int=2 then begin int:=0; tmr1.Enabled:=False; Self.Text:=Int.ToString() ; ShowMessage('Double Click'); end; end; end.

خلال نصف ثانية اذا لم ينقر المستخدم على الزر مرة ثانية يعتبر نقرة واحدة
والا تم اظهار الرسالة
قل: اللهم فاطِرَ السماوات والأرض عالم الغيبِ والشهادة، ربَّ كُلِّ شَيءٍ ومَلِيكَه، أَشْهد أن لا إله إلا أنت، أعوذ بك من شرِّ نفسي وشرِّ الشيطان وشِرْكِهِ وأن أقترف على نفسي سوءًا أو أجرُّه إلى مسلم
[-] كل من 1 user says قال شكرا ل Delphi4Us على المشاركة المفيدة
  • jeanjamil
الرد


الردود في هذا الموضوع
اضافة خاصية dblclick الىtbutton - بواسطة jeanjamil - 07-04-2017, 10:24 AM
RE: اضافة خاصية dblclick الىtbutton - بواسطة Delphi4Us - 07-04-2017, 01:15 PM
RE: اضافة خاصية dblclick الىtbutton - بواسطة Agmcz - 07-04-2017, 03:11 PM

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


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