Back

Using the Delphi ScrollBars Component:

Start a new project. Put two scrollbars on Form1, one ScrollBar (ScrollBar1) at the bottom of Form1 and one ScrollBar on the right side, with the ScrollBar2.Kind property set to sbVertical.
Next drop a Panel component on Form1.

For ScrollBar1 (Horizontal) in the Object Inspector click on Events.
Double-click to the right of OnChange.
Type in this code:
Panel1.Left := ScrollBar1.Position;

For ScrollBar2 (Vertical) in the Object Inspector click on Events.
Double-click to the right of OnChange.
Type in this code:
Panel1.Top := ScrollBar2.Position;

Run the program and try the ScrollBars.


Back