Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread.Model Namespace / SheetSelectionModelEventArgs Class / ColumnCount Property
Example


In This Topic
    ColumnCount Property (SheetSelectionModelEventArgs)
    In This Topic
    Gets the number of columns in the selection.
    Syntax
    'Declaration
     
    Public ReadOnly Property ColumnCount As Integer
    'Usage
     
    Dim instance As SheetSelectionModelEventArgs
    Dim value As Integer
     
    value = instance.ColumnCount
    public int ColumnCount {get;}

    Property Value

    Integer number of columns affected
    Example
    This example returns the number of columns in the selection.
    FarPoint.Win.Spread.Model.BaseSheetSelectionModel model;
    
    model = (FarPoint.Win.Spread.Model.BaseSheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection;
    model.AddSelection(0, 0, 2, 2);
    
    model.Changed += new FarPoint.Win.Spread.Model.SheetSelectionModelEventHandler(model_SelectionModelChanged);
        
    private void button1_Click(object sender, System.EventArgs e)
    {
        model.AddSelection(4, 2, 2, 3);
    }
    
    private void model_SelectionModelChanged(object sender, FarPoint.Win.Spread.Model.SheetSelectionModelEventArgs e)
    {
        textBox1.Text = e.ColumnCount.ToString();
    }
    
    Friend WithEvents model As FarPoint.Win.Spread.Model.BaseSheetSelectionModel
    
    model = fpSpread1.ActiveSheet.Models.Selection
    model.AddSelection(0, 0, 2, 2)
    
    Dim h As FarPoint.Win.Spread.Model.SheetSelectionModelEventHandler = AddressOf model_SelectionModelChanged
    AddHandler model.Changed, h
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        model.AddSelection(4, 2, 2, 3)
    End Sub
    
    Private Sub model_SelectionModelChanged(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.Model.SheetSelectionModelEventArgs)
        TextBox1.Text = e.ColumnCount.ToString()
    End Sub
    
    See Also