HSCROLLBAR Control
A pre-defined control that is "built into" when a virtually dimensioned Window is declared that includes the capability to scroll horizontally
Description:
The HSCROLLBAR control is automatically generated when a virtually dimensioned Window that includes a horizontal 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 horizontal scroll bar
The image below demonstrates the results of querying the HSCROLLBAR Property value
Syntax:
THISWINDOW | <FormName>.HSCROLLBAR.VALUE --> nHScrollBarPos
Valid For Use With:
This property is available for all Window types that can be virtually dimensioned
Notes:
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
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
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
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
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
No help documentation was published with the original or subsequent releases of HMG
Control Properties:
The following Properties is available after the HSCROLLBAR 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