作成日: 2019/07/01 最終更新日: 2019/07/01
文書種別
使用方法
詳細
チェックボックス型セルをクリックしたときには、ButtonClickedイベントが発生します。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' 1列目にチェックボックス型セルを設定
Dim ckbxcell As New FarPoint.Win.Spread.CellType.CheckBoxCellType()
FpSpread1.ActiveSheet.Columns(0).CellType = ckbxcell
End Sub
Private Sub FpSpread1_ButtonClicked(sender As Object, e As FarPoint.Win.Spread.EditorNotifyEventArgs) Handles FpSpread1.ButtonClicked
' チェックボックス型セルの場合
If TypeOf e.EditingControl Is FarPoint.Win.FpCheckBox Then
' イベント発生の確認
Console.WriteLine("ButtonClicked: col={0} row={1} value={2}", e.Column, e.Row, e.View.GetSheetView().ActiveCell.Value)
End If
End Sub
' 1列目にチェックボックス型セルを設定
Dim ckbxcell As New FarPoint.Win.Spread.CellType.CheckBoxCellType()
FpSpread1.ActiveSheet.Columns(0).CellType = ckbxcell
End Sub
Private Sub FpSpread1_ButtonClicked(sender As Object, e As FarPoint.Win.Spread.EditorNotifyEventArgs) Handles FpSpread1.ButtonClicked
' チェックボックス型セルの場合
If TypeOf e.EditingControl Is FarPoint.Win.FpCheckBox Then
' イベント発生の確認
Console.WriteLine("ButtonClicked: col={0} row={1} value={2}", e.Column, e.Row, e.View.GetSheetView().ActiveCell.Value)
End If
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
// 1列目にチェックボックス型セルを設定
FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
fpSpread1.ActiveSheet.Columns[0].CellType = ckbxcell;
}
void fpSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
{
// チェックボックス型セルの場合
if (e.EditingControl is FarPoint.Win.FpCheckBox)
{
// イベント発生の確認
Console.WriteLine("ButtonClicked: col={0} row={1} value={2}", e.Column, e.Row, e.View.GetSheetView().ActiveCell.Value);
}
}
{
// 1列目にチェックボックス型セルを設定
FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
fpSpread1.ActiveSheet.Columns[0].CellType = ckbxcell;
}
void fpSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
{
// チェックボックス型セルの場合
if (e.EditingControl is FarPoint.Win.FpCheckBox)
{
// イベント発生の確認
Console.WriteLine("ButtonClicked: col={0} row={1} value={2}", e.Column, e.Row, e.View.GetSheetView().ActiveCell.Value);
}
}
旧文書番号
84168