Reflection .NET API
Attachmate.Reflection.Emulation.IbmHosts Assembly / Attachmate.Reflection.Emulation.IbmHosts Namespace / IIbmScreen Interface / ExtendSelection Method
The row in which the selection should end.
The column in which the selection should end.
Example


ExtendSelection Method (IIbmScreen)
Selects all text in the terminal window between the selection start position and the specified coordinates.
Syntax
'Declaration
 
Sub ExtendSelection( _
   ByVal row As Integer, _
   ByVal column As Integer _
) 
 
'Usage
 
Dim instance As IIbmScreen
Dim row As Integer
Dim column As Integer
 
instance.ExtendSelection(row, column)

Parameters

row
The row in which the selection should end.
column
The column in which the selection should end.
Exceptions
ExceptionDescription
This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns).
Remarks

Use the SetSelectionStartPos method to set the starting coordinates. (The default starting position is row 1, column 1.)

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

xxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxx

The ExtendSelectionRect method selects 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

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 do not return the selected area. To get the selected region and its properties, use the ScreenRegion object.

Example
This sample selects a text area when the screen is ready. It also gets the selected screen region.
void screen_NewScreenReady(object sender, EventArgs e)
{
    IIbmScreen screen = (IIbmScreen)sender;
 
    //Select text
    screen.SetSelectionStartPos(5, 5);
    screen.ExtendSelection(21, 21);
 
    //get the selected screen region object.
    Attachmate.Reflection.Emulation.IbmHosts.IScreenRegion screenRegionIBM;       
    screenRegionIBM = screen.Selection;
    Console.WriteLine("start row = " + screenRegionIBM.StartRow + ", end row = " + screenRegionIBM.EndRow + 
        ", selection mode = " + screenRegionIBM.CurrentSelectionMode );
}
............
//Attach the event handler to the IbmScreen object's NewScreenReady event,
//where ibmScreen is an instance of IbmScreen.
  screen.NewScreenReady += new EventHandler(screen_NewScreenReady);
...........
See Also