Next: Boolean;
Next(): System.Boolean;
The Next method moves the next element of iterator.
First call of the method performs the transfer to the first element of iterator.
Create a form and locate the following components on the form to execute an example:
TabSheetBox with the TabSheetBox1 name.
UiTabSheet with the UiTabSheet1 name. The UiTabSheet component is the data source for the TabSheetBox component.
The Button components with the Button1 and Button2 names.
Enable the link to the Tab system assembly.
Add the Button1 and Button2 clicks event handler:
Class ITERATORForm: Form
TabSheetBox1: TabSheetBox;
UiTabSheet1: UiTabSheet;
Button1: Button;
Button2: Button;
iter : ITabCellIterator;
tab : ITabSheet;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
tab:= UiTabSheet1.TabSheet;
//create iterator for the selected cells range:
iter := tab.View.Selection.Range.CreateIterator;
//determine the order by columns
iter.Order := TabCellIteratorOrder.Columns;
End Sub Button1OnClick;
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
//in the table select the cells to which the iterator moves
If iter.Next Then
tab.View.Selection.Range := tab.Cell(iter.CurrentRow,iter.CurrentColumn);
End If;
End Sub Button2OnClick;
End Class ITERATORForm;
The form is created after example execution. Enter the values to some cells and select the range which includes this cells:
On clicking the Button1 button (the Create Iterator button in given example), the iterator is created for the selected table range and the By Columns move order to the cells in the table is specified.
Click the Button2 button (the Next button in the given example). The first cell containing the value (the cell A1 in the given example) is selected. The further clicking on the Button2 button selects the cells by which the iterator moves. The move order is set By Columns and the cells are selected in the following order: A1-B2-B3-C0-D2. At the move order selection By Rows the cells are selected in the following order: C0-A1-B2-D2-B3.
Create a NET form and locate the following components on the form to execute the example:
TabSheetBoxNet with the TabSheetBoxNet1 name.
UiTabSheetNet named UiTabSheetNet1. The UiTabSheetNet component is the data source for the TabSheetBoxNet component.
The Button components with the Button1 and Button2 names.
Enable the link to the Tab system assembly:
Imports Prognoz.Platform.Interop.Tab;
Add the Button1 and Button2 clicks event handler:
Public Partial Class ITERATORForm: Prognoz.Platform.Forms.Net.ForeNetForm
Public Constructor OBJ39645Form();
Begin
InitializeComponent();
End Constructor;
iter: ITabCellIterator;
tab: ITabSheet;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Begin
tab:= UiTabSheetNet1.TabSheetUi.TabSheet;
iter := tab.View.Selection.Range.CreateIterator();
iter.Order := TabCellIteratorOrder.tcioColumns;
End Sub;
Private Sub button2_Click(sender: System.Object; e: System.EventArgs);
Begin
//in the table select the cells to which the iterator moves
If iter.Next() Then
tab.View.Selection.Range := tab.Cell[iter.CurrentRow,iter.CurrentColumn];
End If;
End Sub;
End Class;
The result of the Fore.NET Example execution is similar to the Fore Example execution (see above).
See also: