15-04-2017, 12:31 AM
الاخ [size=x-small]s[/size]eddik_xp
شكرا على المشاركة
ايضا هنا كود لتحريك يجعلك تستطيع ان تحرك المكونات وقت التشغيل
وهو بسيط جدا
شكرا على المشاركة
ايضا هنا كود لتحريك يجعلك تستطيع ان تحرك المكونات وقت التشغيل
وهو بسيط جدا
كود :
Title: Move control at runtime
To move control at runtime use mouse events (capture mouse events to prevent default click processing):
type
TForm1 = class(TForm)
...
private
{ Private declarations }
Dragged: Boolean;
OldPos: TPoint;
...
procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if RadioGroup1.ItemIndex=0 then
begin
Dragged:=True;
GetCursorPos(OldPos);
SetCapture(Button1.Handle);
end;
end;
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
NewPos: TPoint;
begin
if Dragged then
with Button1 do
begin
GetCursorPos(NewPos);
Left:=Left-OldPos.X+NewPos.X;
Top:=Top-OldPos.Y+NewPos.Y;
OldPos:=NewPos;
end;
end;
procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Dragged then
begin
ReleaseCapture;
Dragged:=False;
end;
end;
قل: اللهم فاطِرَ السماوات والأرض عالم الغيبِ والشهادة، ربَّ كُلِّ شَيءٍ ومَلِيكَه، أَشْهد أن لا إله إلا أنت، أعوذ بك من شرِّ نفسي وشرِّ الشيطان وشِرْكِهِ وأن أقترف على نفسي سوءًا أو أجرُّه إلى مسلم

