Link Search Menu Expand Document

Spread.SetEditor Method

Explanation Paste the specified object into the cell being edited.

The object is not always displayed, it is displayed only at the cell position when the SetEditor method is executed, and when the cursor moves, the StopEdit event is fired and released.

Make sure to execute the SetEditor method from within the event handler of the StartEdit event. It is possible to call SetEditor at other times, but it will be easier to control if it is processed by the StartEdit and StopEdit events.
Call format Spread1.SetEditor( [ obj ] )
Return value None
Arguments Object obj Specify the object you want to paste for editing.
If obj is not specified, the current setting will be canceled.
Exception None
Example of use
    Number e_row = -1;
    Number e_col = -1;
    Function OnStartEdit(e) {
        if (e.col == 0){
            SetEditor(SpreadForm.TextBox1);
            SpreadForm.TextBox1.SetFocus();
            SpreadForm.TextBox1.Visible = $TRUE;
            e_row = e.row;
            e_col = e.col;
        }
    }
    
    Function OnStopEdit(e){
        if (e.col == e_col && e.row == e_row) {
            Row[e.row].col0 = SpreadForm.TextBox1;
            SpreadForm.TextBox1.Visible = $FALSE;
            e_row = -1;
            e_col = -1;
        }
    }
    
In the above example, the TextBox object that is hidden and created elsewhere is pasted in the StartEdit event and released in the StopEdit event. This allows you to enter cells.
Related item StartEdit, StopEdit events