Attachmate Reflection 2014 .NET API Reference
ExtendSelectionRect Method (IIbmScreen)

The row in which the selection should end.
The column in which the selection should end.
Selects a block of text in the terminal window that includes all rows between the starting row and the specified row.
Sub ExtendSelectionRect( _
   ByVal row As Integer, _
   ByVal column As Integer _
Dim instance As IIbmScreen
Dim row As Integer
Dim column As Integer
instance.ExtendSelectionRect(row, column)
void ExtendSelectionRect( 
   int row,
   int column


The row in which the selection should end.
The column in which the selection should end.
System.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 is row 1, column 1.)

The ExtendSelectionRect method returns a rectangular block of text between the starting and ending row, resulting in a block of text shaped like this:




The ExtendSelection method returns all text in the terminal window between the selection start position and the specified coordinates, resulting in a block of text 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 a new screen is ready. It also gets the selected screen region.
static void screen_NewScreenReady(object sender, EventArgs e)
    IIbmScreen screen = (IIbmScreen)sender;
    //Select a block of text
    screen.SetSelectionStartPos(5, 5);
    screen.ExtendSelectionRect(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);

Target Platforms: Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP, Microsoft Windows Server 2003 Terminal Services, Microsoft Windows Server 2008 Terminal Services

See Also


IIbmScreen Interface
IIbmScreen Members

Send Feedback