GrapeCity SPREAD for Windows Forms 11.0J
Cancel プロパティ (SheetDragMovingEventArgs)


シートのドラッグ移動アクションをキャンセルするかどうかを取得または設定します。
構文
'Declaration
 
Public Property Cancel As Boolean
'使用法
 
Dim instance As SheetDragMovingEventArgs
Dim value As Boolean
 
instance.Cancel = value
 
value = instance.Cancel
public bool Cancel {get; set;}
次のサンプルコードは、Cancelプロパティを使用します。
private void fpSpread1_SheetDragMoving(object sender, FarPoint.Win.Spread.SheetDragMovingEventArgs e)
        {
            if (e.ToSheetIndex == 3)
            {
                e.Cancel = true;
                //or e.Restrict = true;
            }
        }

        private void fpSpread1_SheetDragMoved(object sender, FarPoint.Win.Spread.SheetDragMovedEventArgs e)
        {
            listBox1.Items.Add("previous " + e.OldSheetIndex);
            listBox1.Items.Add("new " + e.NewSheetIndex);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            fpSpread1.Sheets.Count = 5;
            fpSpread1.AllowSheetMove = true;
        }
Private Sub FpSpread1_SheetDragMoved(sender As Object, e As FarPoint.Win.Spread.SheetDragMovedEventArgs) Handles FpSpread1.SheetDragMoved
        ListBox1.Items.Add("previous " & e.OldSheetIndex)
        ListBox1.Items.Add("new " & e.NewSheetIndex)
    End Sub

    Private Sub FpSpread1_SheetDragMoving(sender As Object, e As FarPoint.Win.Spread.SheetDragMovingEventArgs) Handles FpSpread1.SheetDragMoving
        If e.ToSheetIndex = 3 Then
            e.Cancel = True
           'or e.Restrict = True
        End If
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        FpSpread1.Sheets.Count = 5
        FpSpread1.AllowSheetMove = True
    End Sub
参照

SheetDragMovingEventArgs クラス
SheetDragMovingEventArgs メンバ

 

 


© 2004-2018, GrapeCity Inc. All rights reserved.