VSCROLLBAR Control

 

A pre-defined control that is "built into" when a virtually dimensioned Window is declared that includes the capability to scroll vertically

 

 

Description:

 

The VSCROLLBAR control is automatically generated when a virtually dimensioned Window that includes a vertical scroll bar is declared. It cannot be declared in any other way. It can be manipulated to access a numeric VALUE property which identifies the position in which the scroll box is positoned within the vertical scroll bar

 

The image below demonstrates the results of querying the VSCROLLBAR Property value

 

VScrollBar Control

 

Syntax:

 

    THISWINDOW | <FormName>.VSCROLLBAR.VALUE --> nVScrollBarPos

 

Valid For Use With:

 

This property is available for all Window types that can be virtually dimensioned

 

Notes:

  1. During testing it was found that if any Control defined within a virtually dimensioned Window, such as a LABEL, has the AUTOSIZE .T. Property, then the Control is re-located within the in the CLIENTWORKAREA if the content of the Control is changed. This has the effect of making the Control appear to "jump around" on screen after any changes to their values

  2. To see this, change the AUTOSIZE Properties for Lbl1 and Lbl2 in the sample source code file below to .T., compile (build) it and then follow the instructions on screen

  3. However, if the Control has an AUTOSIZE .F. Property, its' placement is anchored in the virtual screen rather than in the CLIENTWORKAREA if the content of that Control is changed

  4. The sample code file (below) includes code that dynamically updates the HSCROLLBAR, VSCROLLBAR, CLIENTAREAWIDTH and CLIENTAREAHEIGHT Properties. These can change if the scroll bars are used or if the Window is re-sized or maximized. Additional code also turns the scroll bars off in the event that the Client Area size equals of exceeds the virtual dimensions set for the Window

  5. During testing it was found that if the scroll bars are used and are then turned off when the Window has been re-sized beyond its' virtual dimensions, or is maximized, there does not appear to be an easy way to re-position the controls on the screen so that they are positioned in their original places; they remain displayed at their position as if the are still being displayed within a virtually dimensioned Window

  6. No help documentation was published with the original or subsequent releases of HMG

Control Properties:

 

The following Properties is available after the VSCROLLBAR Control has been defined

 

VALUE Numeric R Gets a numeric value representing the position of the scroll box within the control

 

D - Properties of this type can be used when defining a Window

R - Properties of this type can only be accessed (read) after the Window has been defined

W - Properties of this type can be changed (write) after the Window has been defined

 

See GETPROPERTY and SETPROPERTY functions for further infomation on accessing or changing properties or use semi-OOP syntax

 

Sample Code:

 

Sample code to test this Property can be found here