作成日: 2017/02/15 最終更新日: 2017/02/15
文書種別
使用方法
詳細
コンボボックス型セルでは、EditorValueプロパティの定義により取得する値を文字列/インデックス値のいずれかに設定することができますので、対象セルのValueプロパティ値を設定することで任意のリストを指定することが可能です。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim c As New FarPoint.Win.Spread.CellType.ComboBoxCellType()
c.Items = New String() {"aaa", "bbb", "ccc"}
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index
FpSpread1.ActiveSheet.Cells(0, 0).CellType = c
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
FpSpread1.ActiveSheet.Cells(0, 0).Value = 1
End Sub
Dim c As New FarPoint.Win.Spread.CellType.ComboBoxCellType()
c.Items = New String() {"aaa", "bbb", "ccc"}
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index
FpSpread1.ActiveSheet.Cells(0, 0).CellType = c
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
FpSpread1.ActiveSheet.Cells(0, 0).Value = 1
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
FarPoint.Win.Spread.CellType.ComboBoxCellType c = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
c.Items = new string[] { "aaa", "bbb", "ccc" };
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = c;
}
private void button1_Click(object sender, EventArgs e)
{
fpSpread1.ActiveSheet.Cells[0, 0].Value = 1;
}
{
FarPoint.Win.Spread.CellType.ComboBoxCellType c = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
c.Items = new string[] { "aaa", "bbb", "ccc" };
c.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = c;
}
private void button1_Click(object sender, EventArgs e)
{
fpSpread1.ActiveSheet.Cells[0, 0].Value = 1;
}
関連情報
旧文書番号
39934