المشاركات : 152
المواضيع 93
:
: 26
الإنتساب : Oct 2015
السلام عليكم
كيف اضيف خاصية dblclick
الى button1
المشاركات : 1,677
المواضيع 349
:
: 1,069
الإنتساب : Nov 2013
07-04-2017, 01:15 PM
(آخر تعديل لهذه المشاركة: 07-04-2017, 01:16 PM بواسطة Delphi4Us.)
وعليكم السلام ورحمة الله
لا اعرف ان كان هناك شئ بدوال 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.
خلال نصف ثانية اذا لم ينقر المستخدم على الزر مرة ثانية يعتبر نقرة واحدة
والا تم اظهار الرسالة
قل: اللهم فاطِرَ السماوات والأرض عالم الغيبِ والشهادة، ربَّ كُلِّ شَيءٍ ومَلِيكَه، أَشْهد أن لا إله إلا أنت، أعوذ بك من شرِّ نفسي وشرِّ الشيطان وشِرْكِهِ وأن أقترف على نفسي سوءًا أو أجرُّه إلى مسلم
المشاركات : 654
المواضيع 34
:
: 106
الإنتساب : Aug 2010
07-04-2017, 03:11 PM
(آخر تعديل لهذه المشاركة: 07-04-2017, 03:16 PM بواسطة Agmcz.)
هكدا
PHP كود :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TButton = class(StdCtrls.TButton)
private
procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK;
end;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TButton }
procedure TButton.WMLButtonDblClk(var Message: TWMLButtonDblClk);
begin
ShowMessage('Db Test');
end;
end.
انتبه الحدث سستأثر به كل الأصناف الشبيهة
سبحان الله وبحمده سبحان الله العظيم
كل من 1 user says قال شكرا ل Agmcz على المشاركة المفيدة1 user says Thank You to Agmcz for this post
• jeanjamil