Autor Beitrag
UWER
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 79

SUSE 8.1, XP Home
D7 Prof. , Kylix 3
BeitragVerfasst: Mi 09.04.03 06:39 
Hallo Leute,

ich muß für eine Anwendung Knoten in einer TreeView per Drag&Drop verschieben. Das ist solange kein Problem bis ich den kompletten Baum in der TreeView unterkriege, wenn der jedoch zu groß wird muß ich den TreeView dazu kriegen automatisch zu scrollen. Kann mir da jemand einen Tip geben wie ich das hinkriege?

Gruß
UweR
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 09.04.03 08:56 
Den Code habe ich mal irgendwo im Internet gefunden:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer; 
  State: TDragState; var Accept: Boolean); 
begin 
  if (y < 15) then {On the upper edge - should scroll up } 
    SendMessage(TreeView1.Handle, WM_VSCROLL, SB_LINEUP, 0) 
  else if (TreeView1.Height - y < 15) then { On the lower edge - should scroll down } 
    SendMessage(TreeView1.Handle, WM_VSCROLL, SB_LINEDOWN, 0); 
end;


Gruß
Tino
UWER Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 79

SUSE 8.1, XP Home
D7 Prof. , Kylix 3
BeitragVerfasst: Mi 09.04.03 09:09 
Hallo Tino,

DANKE!!

Das war genau das was ich gesucht hatte!

Gruß
UweR