boundingWidth property

Retrieves the width of the rectangle that bounds the TextRange object.

Syntax

JScript

p = object.boundingWidth

Property values

Type: Integer

the width of the bounding rectangle, in pixels.

Examples

This example retrieves the value of the boundingWidth property for the given text area.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/boundingTop.htm


<html>
<head>
  <title>boundingHeight</title>
</head>
<body>
  <textarea cols="100" rows="2" onclick="boundDim(this)"> . . . </textarea>
  <script>
    function boundDim(oObject) {
      var oTextRange = oObject.createTextRange();
      if (oTextRange != null) {
        console.log("The bounding width is " + oTextRange.boundingWidth);
      }
    }
  </script>
</body>
</html>

See also

TextRange
Reference
boundingHeight
boundingLeft
boundingTop

 

 

Show:
© 2014 Microsoft