イベント ハンドラが、このイベントに関連するデータを含む、EditErrorEventArgs 型の引数を受け取りました。次の EditErrorEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 説明 |
---|
Column | エディタがイベントを発生させたセルの列インデックスを取得します。 |
EditError | 編集エラーの種類を取得します。 |
Row | エディタがイベントを発生させたセルの行インデックスを取得します。 |
View | エディタがイベントを発生させたセルを含むビューを取得します。 |
次のサンプルコードは、ユーザーが無効な入力操作を行ったときにEditErrorイベントを発生させます。
fpSpread1.ActiveSheet.Cells[0, 0].Locked = true;
fpSpread1.ActiveSheet.Cells[0, 0].BackColor = Color.Black;
Label1.Text = "Double-click on the black cell. It is locked. This will fire the event";
private void fpSpread1_EditError(object sender, FarPoint.Win.Spread.EditErrorEventArgs e)
{
ListBox1.Items.Add(e.EditError.ToString());
}
FpSpread1.ActiveSheet.Cells(0, 0).Locked = True
FpSpread1.ActiveSheet.Cells(0, 0).BackColor = Color.Black
Label1.Text = "Double-click on the black cell. It is locked. This will fire the event"
Private Sub FpSpread1_EditError(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditErrorEventArgs) Handles FpSpread1.EditError
ListBox1.Items.Add(e.EditError.ToString())
End Sub