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
Property Position TTeeScrollBar
Hi Joerg,
You can move the scrollbar by code as in the following example:
Regards,
tom
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;
tom