Parameters
- row
- The row in which the selection ends.
- column
- The column in which the selection ends.
Exception | Description |
---|---|
ArgumentOutOfRangeException | This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns). |
Use the SetSelectionStartPos method to set the starting coordinates. (The default starting position is row 1, column 1.)
The ExtendSelectionRect method returns a rectangular block of text between the starting and ending row. The starting and the ending coordinate columns define the vertical edges of the block. The resulting block of text is shaped like this:
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
The ExtendSelection method selects the stream from the starting position coordinate to the extended position coordinate and returns a text selection shaped like this:
xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
If the ending coordinates are smaller than the starting coordinates, the ExtendSelectionRect and ExtendSelection methods select text backwards (from right to left or bottom to top).
These methods select text but do not return the selected area. To get the selected region and its properties, use the ScreenRegion object.
Private Sub IbmScreen_NewScreenReady(ByVal sender As Variant) Dim screenRegionIbm As ScreenRegion 'Select the text area ThisIbmScreen.SetSelectionStartPos 5, 5 ThisIbmScreen.ExtendSelectionRect 21, 21 'Get the selected screen region Set screenRegionIbm = ThisIbmScreen.selection MsgBox ("Start Row = " & screenRegionIbm.StartRow & ", End Column = " & screenRegionIbm.EndColumn) End Sub