میخوام مثلا بین دو edit متن اونا رو با عمل drag جا به جا کنم . از edit 1 به edit 2 چکار کنم ؟
یا مثلا یک تصویر رو روی یک فرم با عمل drag جابه جا کنم .
بطوری که تصویر در جای خاصی از فرم ثابت شود .
ممنون میشم اگه جواب منو بدید
میخوام مثلا بین دو edit متن اونا رو با عمل drag جا به جا کنم . از edit 1 به edit 2 چکار کنم ؟
یا مثلا یک تصویر رو روی یک فرم با عمل drag جابه جا کنم .
بطوری که تصویر در جای خاصی از فرم ثابت شود .
ممنون میشم اگه جواب منو بدید
سلام
یک مثال تر وتمیز از راهنمای دلفی عزیز :
This code comes from an application that contains a list box and three labels, each with a different font and color. The DragMode property for each of the labels is dmAutomatic. The user can select a label and drag it to a list box and drop it. When the label is dropped, the items in the list box assume the color and font of the dropped label.
This OnDragOver event handler permits the list box to accept a dropped label:
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
Accept := Source is TLabel;
end;
This OnDragDrop event handler implements the drop behavior.
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if (Sender is TListBox) and (Source is TLabel) then
begin
with Sender as TListBox do
begin
Font := (Source as TLabel).Font;
Color := (Source as TLabel).Color;
end;
end;
end;
روز خوش :)
با سلام خدمت شما عزیزان
می خواستم ببینم که برای اینکه یک item از یک listbox رو توسط ماوس به یک listbox دیگه dragdrop کنم باید چیکار کنم .
یه سربه این آدرس بزن یه نمونه آپلود کردم . البته در سایت هم هست اما زحمت جستجو با خودت
http;//www.Delphi-Magic.com/source.php
موفق باشید
درباره Drag کردن قبلا در سایت بحث شده:
http://www.barnamenevis.org/sh...highlight=Drag
http://www.barnamenevis.org/sh...highlight=Drag
http://www.barnamenevis.org/sh...highlight=Drag
http://www.barnamenevis.org/sh...highlight=Drag
و...
وَ سَيَعْلَمُ الَّذِينَ ظَلَمُوا [آل محمد حقهم] أَيَّ مُنْقَلَبٍ يَنْقَلِبُونَ - الشعراء (227)
و ظالمین [حق آل محمد (ص) ] به زودی خواهند دانست که به کدام بازگشتگاه بازخواهند گشت.