RAD Studio VCL Reference
|
Represents the horizontal scroll bar for the scrolling windowed control.
property HorzScrollBar: TControlScrollBar;
__property TControlScrollBar HorzScrollBar;
Use HorzScrollBar to hide, show, or manipulate the horizontal scroll bar for the scrolling windowed control.
C++ Examples:
/* This example starts the form in a position scrolled so that the right hand edge shows: */ void __fastcall TForm1::FormCreate(TObject *Sender) { /* set the width of the form window to display 300 pixels in the client area */ ClientWidth = 300; /* now set the range to twice the client width. This means that the form has a logical size that is twice as big as the physical window. Note that Range must always be at least as big as ClientWidth! */ HorzScrollBar->Range = 600; /* start the form fully scrolled */ HorzScrollBar->Position = HorzScrollBar->Range - ClientWidth; /* clicking the scroll arrows moves the form 10 pixels */ HorzScrollBar->Increment = 10; HorzScrollBar->Visible = true; // Show the scrollbar }
Delphi Examples:
{ This example starts the form in a position scrolled so that the right hand edge shows: } procedure TForm1.FormCreate(Sender: TObject); begin ClientWidth := 300; with HorzScrollBar do begin { Set the range to twice the ClientWidth of the form } { This means that the form’s logical size is twice as big } { as the physical window. } { Note that Range must always be larger than the ClientWidth } Range := 600; Position := Range - ClientWidth; { start form out fully scrolled } Increment := 10; { clicking the scroll arrows moves the form 10 pixels } Visible := True; { Show the scrollbar } end; end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|