Autor Beitrag
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Di 18.01.05 19:39 
hi leutz!

und zwar verschiebe ich per drag drop ein image auf dem formular! das hat schon seinen sinn, und es funzt auch wunderbar! nur hab ich ein problem! ich würde gern während des verschiebens einen rahmen anzeigen lassen,wo sich das object befinden würde, wenn man es jetzt loslässt!

so wie bei delphi in der entwicklungsumgebung, wo man komponenten verschiebn kann!!

kennt ihr da ne möglichkeit?


mfg matthias
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 18.01.05 20:11 
Das Bild die ganze Zeit anzeigen ist nicht ok??

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Matthias-K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Di 18.01.05 20:27 
das macht der doch auch net! hab bloß die maus, und dann setzt er es in dorthin, wo ie maus ist! habs so gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  if (sender is tpanel) and (source is timage) then
  with source as timage do
  begin
    left := x;
    top := y;
  end;


geil wäre es, wenn er das ding die ganze zeit anzeigen würde, aber da weis ich net, wie das geht!
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 18.01.05 20:33 
Wie wärs damit?? :wink:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
unit Unit1;

(...)

var
  Form1: TForm1;
  Ziehen: Boolean;
  DiffX, DiffY: Integer;

(...)

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
Ziehen := True;
DiffX := X;
DiffY := Y;
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
Ziehen := False;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if Ziehen then Image1.Left := Image1.Left + X - DiffX;
if Ziehen then Image1.Top := Image1.Top + Y - DiffY;
end;

end.


Ich weiß nicht, ob das ist, was du willst... :gruebel:

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 18.01.05 20:37 
Falls du damit irgendwie nicht zurecht kommst, hab ich das auch mal hochgeladen.

Delphi 6 Personal Quellcode:
glaessi.piranho.com/delphi/Project2.zip

ACHTUNG: Rechtsanklicken und "Ziel speichern unter", sonst funktioniert der Link nicht.. :D

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.