scrollHorzPos

Type: Integer

Availability: Read or write at run time only

The scrollHorzPos property contains the position of the horizontal scroll bar. The units are pixels, except for a text box control where the horizontal positions are characters.

The scrollHorzPos property applies to Form, Picture, TextBox, ListBox, and JadeRichText controls. (Use the topRow and leftColumn properties to set the scroll positions for Table controls.)

If the scroll bar is not defined for the form or control, a value of zero (0) is returned, and setting the scrollHorzPos property has no effect.

Setting the value of the scrollHorzPos property when the horizontal scroll bar is defined scrolls the window to that horizontal position relative to the minimum scroll range value. Setting this property to a value outside the scroll range results in an exception being raised.

For the JadeRichText control, the scrollHorzPos property contains the horizontal position in the virtual text space corresponding to the point displayed on the left hand side of the control. The units are characters. If the scroll bar is not defined for the control, the value of this property defaults to zero (0) and setting the scrollHorzPos property has no effect.

The scrolled event is not generated as a result of setting a new scroll position.

This property can also be used to convert physical window positions into logical positions; as shown in the following example.

list1_mouseDown(listbox: ListBox input; button: Integer; shift: Integer;
                x: Real; y: Real) updating;
begin
    xpos := x + list1.scrollHorzPos;      // logical pos for mouse down
end;