Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / ExtendSelectionRect Method
The row in which the selection ends.
The column in which the selection ends.
In This Topic
    ExtendSelectionRect Method (IbmScreen)
    In This Topic
    Selects a block of text in the terminal window that includes all rows between the starting row and the specified row.
    expression.ExtendSelectionRect( _
       ByVal row As Integer, _
       ByVal column As Integer _
    where expression is a variable that represents a IbmScreen Object


    The row in which the selection ends.
    The column in which the selection ends.
    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:




    The ExtendSelection method selects the stream from the starting position coordinate to the extended position coordinate and returns a text selection shaped like this:




    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.

    This sample selects a block of text when the screen is ready. It also gets the selected screen region.
    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
    See Also