Partilhar via


FormListControl.deleteColumn(Int32) Method

Definition

Deletes a specified column in a form list control.

public:
 virtual bool deleteColumn(int _Idx);
public virtual bool deleteColumn (int _Idx);
abstract member deleteColumn : int -> bool
override this.deleteColumn : int -> bool
Public Overridable Function deleteColumn (_Idx As Integer) As Boolean

Parameters

_Idx
Int32

An Integer data type that specifies a column in a form list control.

Returns

true if the column is deleted; otherwise, false.

Remarks

The following example shows a call to the deleteColumn method to delete the first column in the form list control. The FormListControl.addColumn method adds two columns to the form list control.

static void createForm(Args _args) 
{ 
    Args args; 
    Form form; 
    FormRun formRun; 
    FormBuildDesign formBuildDesign; 
    FormBuildDataSource formBuildDataSource; 
    FormBuildListControl formBuildListControl; 
    FormListControl formListControl; 
    FormListColumn formListColumn; 
    int idx4; 
    DictTable dictTable; 
    CustTable custTable; 
    boolean columnDel; 
    // Create the form header. 
    form = new Form(); 
    // Add data sources to the form. 
    dictTable = new DictTable(tableNum(custTable)); 
    formBuildDataSource = form.addDataSource(dictTable.name()); 
    formBuildDataSource.table(dictTable.id()); 
    // Create the form design. 
    formBuildDesign = form.addDesign("Design"); 
    formBuildDesign.caption("myForm"); 
    // Add a form list control. 
    formBuildListControl = 
 formBuildDesign.addControl(FormControlType::ListView,"List"); 
    idx4 = formBuildListControl.id(); 
    args = new Args(); 
    args.object(form); 
    // Create the run-time form. 
    formRun = classfactory.formRunClass(args); 
    formRun.run(); 
    formRun.detach(); 
    formListControl = formRun.control(idx4); 
    formListControl.viewType(FormListViewType::Report); 
    formListControl.height(120); 
    formListControl.widthMode(FormWidth::ColumnWidth); 
    // Add columns to the form list control. 
    formListControl.addColumn(0, new FormListColumn("Column1",1,120)); 
    formListControl.addColumn(1, new FormListColumn("Column2",2,120)); 
    // Delete a column. 
    columnDel = formListControl.deleteColumn(0); 
}

Applies to