Property Position TTeeScrollBar

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Joerg
Newbie
Newbie
Posts: 12
Joined: Mon Aug 16, 2004 4:00 am
Location: Germany

Property Position TTeeScrollBar

Post by Joerg » Tue Jun 19, 2007 6:17 am

Hi,
if we add shapes or fill a tree or selected one shape we want to reposition the visible part of the tree programmatically. But it is impossible? The property position is read only. The help show:

'...When the user scrolls the scroll bar, the value of Position changes. Set Position to programmatically move the thumb tab of the scroll bar.'

How can I do that? Often scrolled the first shape (root) away although it is the only one. What is the reason? :?:

with regards
Joerg

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Wed Jun 20, 2007 8:44 pm

Hi Joerg,

You can move the scrollbar by code as in the following example:

Code: Select all

procedure TForm2.btnMoveHorzScrollBarClick(Sender: TObject);
var tmpPos : Integer;
begin
  tmpPos := (Tree1.HorzScrollBar.Max-Tree1.HorzScrollBar.Min) div 2;
  tmpPos := tmpPos - (Tree1.HorzScrollBar.PageSize div 2);
  Tree1.View3DOptions.HorizOffset := -tmpPos;
end;
Regards,
tom

Post Reply