IHTMLTextContainer

IHTMLTextContainer


This interface provides access to properties and methods that are common to the BODY, BUTTON, CAPTION, DIV, MARQUEE, TABLE, and TEXTAREA elements.

IHTMLTextContainer Methods
createControlRange   get_scrollHeight   get_scrollWidth  
put_scrollTop   get_scrollTop   put_scrollLeft  
get_scrollLeft   put_onscroll   get_onscroll  

IHTMLTextContainer::createControlRange

HRESULT createControlRange( 
    IDispatch **range 
);

Creates a selection range object for control-based selection rather than text-based selection. If there are currently controls selected in the text container, the control range is initialized with them; otherwise, it is created empty and controls need to be explicitly added to it. This is opposite of the text range, which defaults to the whole text container if there is no selection. This returns an IHTMLControlRange object.

range
Address of a pointer to a variable of IDispatch type.

IHTMLTextContainer::get_onscroll

HRESULT get_onscroll(
    VARIANT *p 
);

Occurs when the scroll box is repositioned. The default action of this event is to scroll.

p
Address of a VARIANT structure that contains the script.

See also put_onscroll

IHTMLTextContainer::get_scrollHeight

HRESULT get_scrollHeight(
    long *p 
);

Retrieves the element's scrolling height, in pixels. This is the distance between the top and bottom edges of the element's visible content. The physical height of the content, including nonvisible content, can be obtained with the IHTMLElement::get_offsetHeight property.

p
Address of a variable that receives the scroll height.

This property is read-only on HTML documents, and read-write on fixed regions.

See also get_scrollWidth

IHTMLTextContainer::get_scrollLeft

HRESULT get_scrollLeft(
    long *p 
);

Retrieves the distance, in pixels, between the left edge of the element and the leftmost portion of the element that is currently visible in the window. This is equal to the horizontal distance that the content of the element has been scrolled.

p
Address of a variable that receives the scroll-left distance.

This read-write property is always a nonnegative integer. Although it can be set to any positive or negative value, the property is set to zero if the assigned value is less than zero, and is set to the value of scrollWidth if the assigned value is greater than this. The default value is zero.

This property is always zero for elements that do not support scroll bars. For these elements, setting the property has no effect.

See also put_scrollLeft

IHTMLTextContainer::get_scrollTop

HRESULT get_scrollTop(
    long *p 
);

Retrieves the distance, in pixels, between the top of the element and the topmost portion of the content that is currently visible in the window. This is equal to the vertical distance that the content of the element has been scrolled.

p
Address of a variable that receives the scroll top distance.

This read-write property is always a nonnegative integer. Although it can be set to any positive or negative value, the property is set to zero if the assigned value is less than zero, and is set to the value of scrollHeight if the assigned value is greater than this. The default value is zero.

This property is always zero for elements that do not have scroll bars. For these elements, setting the property has no effect.

See also put_scrollTop

IHTMLTextContainer::get_scrollWidth

HRESULT get_scrollWidth(
    long *p 
);

Retrieves the element's scrolling width, in pixels. This is the distance between the left and right edges of the element's visible content.

p
Address of a variable that receives the scroll width.

This property is read-only on HTML documents, and read-write on fixed regions.

See also get_scrollHeight

IHTMLTextContainer::put_onscroll

HRESULT put_onscroll(
    VARIANT v 
);

Occurs when the scroll box is repositioned. The default action of this event is to scroll.

v
VARIANT structure that contains the script to be set.

See also get_onscroll

IHTMLTextContainer::put_scrollLeft

HRESULT put_scrollLeft(
    long v 
);

Sets the distance, in pixels, between the left edge of the element and the leftmost portion of the element that is currently visible in the window. This is equal to the horizontal distance that the content of the element has been scrolled.

v
Value specifying the scroll-left distance.

This read-write property is always a nonnegative integer. Although it can be set to any positive or negative value, the property is set to zero if the assigned value is less than zero, and is set to the value of scrollWidth if the assigned value is greater than this. The default value is zero.

This property is always zero for elements that do not support scroll bars. For these elements, setting the property has no effect.

See also get_scrollLeft

IHTMLTextContainer::put_scrollTop

HRESULT put_scrollTop(
    long v 
);

Sets the distance, in pixels, between the top of the element and the topmost portion of the content that is currently visible in the window. This is equal to the vertical distance that the content of the element has been scrolled.

v
Value specifying the scroll top distance.

This read-write property is always a nonnegative integer. Although it can be set to any positive or negative value, the property is set to zero if the assigned value is less than zero, and is set to the value of scrollHeight if the assigned value is greater than this. The default value is zero.

This property is always zero for elements that do not have scroll bars. For these elements, setting the property has no effect.

See also get_scrollTop

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.