Hello,
Is it possible to force the position of the vertical scrollbar ? Sometimes i must build again all my treeview, and i would like to show the treeview at the same position as before it has been rebuilt.
[Solved] Force position of vertical scrollbar ?
[Solved] Force position of vertical scrollbar ?
Last edited by bertrod on Tue Jan 15, 2008 8:20 am, edited 1 time in total.
Hi,
You can move the scrollbars to a position with the VertOffset and/or HorizOffset of the View3DOptions.
So before rebuilding, you could store these values in temporary variables. After rebuild, you assign them back to VertOffset and HorizOffset.
Regards,
Tom.
You can move the scrollbars to a position with the VertOffset and/or HorizOffset of the View3DOptions.
So before rebuilding, you could store these values in temporary variables. After rebuild, you assign them back to VertOffset and HorizOffset.
Code: Select all
procedure TForm2.btnRebuildClick(Sender: TObject);
var tmpH, tmpV: Integer;
begin
tmpH := Tree1.View3DOptions.HorizOffset;
tmpV := Tree1.View3DOptions.VertOffset;
Tree1.View3DOptions.HorizOffset := 0; //Simulate rebuild
Tree1.View3DOptions.VertOffset := 0;
Tree1.View3DOptions.HorizOffset := tmpH;
Tree1.View3DOptions.VertOffset := tmpV;
end;
Tom.