{"id":100,"date":"2007-05-12T14:06:39","date_gmt":"2007-05-12T12:06:39","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/scroll-treeview-when-dragdrop\/"},"modified":"2007-05-12T14:06:41","modified_gmt":"2007-05-12T12:06:41","slug":"scroll-treeview-when-dragdrop","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/scroll-treeview-when-dragdrop\/","title":{"rendered":"Scroll Treeview when Drag\/Drop"},"content":{"rendered":"<p><em>jj wrote:<br \/>\n><br \/>\n> Hello, clever types.<br \/>\n><br \/>\n> I have a treeview filled with a multi-level structure and i want<br \/>\n> to drag and drop component nodes etc&#8230;<br \/>\n><br \/>\n> How do i make the treeview scroll up\/down\/left\/right when i drag a<br \/>\n> node to the edge of the treeview&#8230; Just like Windows explorer does<br \/>\n> when dragging files&#8230;<br \/>\n><br \/>\n> Thankyoo<br \/>\n><br \/>\n> Jon<br \/>\n<\/em><br \/>\nI use the OnDragOver event and place code like this:<\/p>\n<p>[code lang=&#8221;delphi&#8221;]procedure TSomeForm.TreeViewDragOver(Sender, Source: TObject;<br \/>\n    X,Y: Integer; State: TDragState; var Accept: Boolean);<br \/>\nbegin<br \/>\n  If (y<15) Then \/\/On the upper edge - should scroll up\n    SendMessage(TreeView.Handle,WM_VSCROLL,SB_LINEUP,0)\n  else If (TreeView.Height-y<15) Then \/\/ On the lower edge - should scroll down\n    SendMessage(TreeView.Handle,WM_VSCROLL,SB_LINEDOWN,0);\n  end;\n\nEyal.[\/code]\n\n[tags]Delphi, Components, TreeView[\/tags]\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jj wrote: > > Hello, clever types. > > I have a treeview filled with a multi-level structure and i want > to&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75,95],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1C","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/100"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}