Autor Beitrag
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mo 08.08.05 15:09 
Hallo, ich hab dazu hier im Forum zwar schon ne Menge gefunden, aber alles lief dann auf die Komponente hinaus, die das programm zu einer art taskleiste macht, was ich aber nicht vorhabe, das programm soll einfach nur vom desktop rand angezogen werden, wie mache ich das am besten ? ich hab da zwar schon eine idee, aber dazu brauche ich etwas wie ein OnMove Event, gibt's da sowas ? :roll:

code würde dann so aussehen:
ausblenden Delphi-Quelltext
1:
2:
  if Left + Width > screen.Width - 10 then
    Left := screen.width - width;



EDIT: Glöst: Zuerst mit nem Timer getestet, dann das Zittern für schlecht und unbehebbar befunden, dann im onmouseup probiert, fehlanzeige, die Lösung:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TMainForm.S_MovementZoneMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  Perform(wm_syscommand, $f012, 0);
  if Left + Width > screen.Width - 25 then
    Left := screen.width - width;
  if Left < 25 then
    Left := 0;
  if Top + Height > screen.Height + 25 then
    Top := screen.Height - height;
  if Top < 25 then
    Top := 0;
end;

(Hab Form ohne Border :lol: )
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 09.08.05 08:49 
schau dir mal diese Lösung an... die finde ich etwas besser als einen timer zu verwenden. ;-)

delphi.about.com/od/...logs/l/aa070301a.htm

lg Martin
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 09.08.05 13:08 
das ist nicht im timer drin, pack den code mal ins inmousedown deines formulares, dann kannst es an den rand ziehen und es dockt :D