![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Перетаскивание Image a по Image у [D6, D7, WinME, Win2k]
LongIsland © (2002-11-16 17:04:00)В программе понадобилось сделать сабж. Для перетаскиваемого делаю так:
procedure TfmMain.imAuxiliaryMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Down:=True;
LeftPos:=X;
TopPos:=Y;
end;
procedure TfmMain.imAuxiliaryMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if Down then
begin
imAuxiliary.Left:=X-LeftPos;
imAuxiliary.Top:=Y-TopPos;
end;
end;
procedure TfmMain.imAuxiliaryMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Down then
begin
imAuxiliary.Left:=X-LeftPos;
imAuxiliary.Top:=Y-TopPos;
end;
Down:=False;
end;
Но сам рисунок жестоко плющит, его то и дело срывает обратно, мигает:-( В обчем, не хочет он нормально себя вести, несмотря на то, чтоParent.DoubleBuffered:=False;у обоих:-(
Как поступить? СПАСИБО ЗАРАНЕЕ!!!
LongIsland (2002-11-16 17:50:00) [1]Еще раз спасибо всем!
TTCustomDelphiMaster (2002-11-16 17:37:00) [2]imAuxiliary.Left:=imAuxiliary.Left+X-LeftPos;
imAuxiliary.Top:=imAuxiliary.Top+Y-TopPos;
LongIsland (2002-11-16 17:35:00) [3]
> MBo © (16.11.02 17:29)
СПАСИБО АААААГРОМНОЕ!!!
Кстати,Parent.DoubleBuffered:=True;Наврал я здесь:-)
MBo (2002-11-16 17:29:00) [4]
procedure TForm1.Image2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Down:=True;
LeftPos:=X;
TopPos:=Y;
end;
procedure TForm1.Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Down then
begin
image2.Left:=image2.Left+X-LeftPos;
image2.Top:=image2.Top+Y-TopPos;
end;
end;
procedure TForm1.Image2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Down then
Down:=False;
end;