数値/パーセント/通貨/日付時刻型セルで電卓/カレンダー(サブエディタ)が表示されるのを抑制したい
対象製品
SPREAD for Windows Forms 8.0J
詳細
数値/パーセント/通貨/日付時刻型セル上でのF4キー押下時または編集セルでのダブルクリックで、電卓またはカレンダーが表示されます。これらを抑制するには、EnableSubEditorプロパティをFalseにするか、表示の際に発生するSubEditorOpeningイベントにてその動作をキャンセルします。EnableSubEditorプロパティは、SPREADデザイナからも設定が可能です。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim numcell As New FarPoint.Win.Spread.CellType.NumberCellType()
' サブエディタを非表示にします
numcell.EnableSubEditor = False
FpSpread1.ActiveSheet.Cells(0, 0).CellType = numcell
End Sub
Private Sub FpSpread1_SubEditorOpening(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.SubEditorOpeningEventArgs) Handles FpSpread1.SubEditorOpening
'e.Cancel = True
End Sub
Dim numcell As New FarPoint.Win.Spread.CellType.NumberCellType()
' サブエディタを非表示にします
numcell.EnableSubEditor = False
FpSpread1.ActiveSheet.Cells(0, 0).CellType = numcell
End Sub
Private Sub FpSpread1_SubEditorOpening(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.SubEditorOpeningEventArgs) Handles FpSpread1.SubEditorOpening
'e.Cancel = True
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
FarPoint.Win.Spread.CellType.NumberCellType numcell = new FarPoint.Win.Spread.CellType.NumberCellType();
// サブエディタを非表示にします
numcell.EnableSubEditor = false;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = numcell;
}
private void fpSpread1_SubEditorOpening(object sender, FarPoint.Win.Spread.SubEditorOpeningEventArgs e)
{
//e.Cancel = true;
}
{
FarPoint.Win.Spread.CellType.NumberCellType numcell = new FarPoint.Win.Spread.CellType.NumberCellType();
// サブエディタを非表示にします
numcell.EnableSubEditor = false;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = numcell;
}
private void fpSpread1_SubEditorOpening(object sender, FarPoint.Win.Spread.SubEditorOpeningEventArgs e)
{
//e.Cancel = true;
}
キーワード
セル型