SPREAD for ASP.NET 8.0J サンプルコード集
コンボボックスのフォントを変更する

コンボボックス型セルのCssClassプロパティにスタイルシートを設定します。

実行例:

//コンボボックスは編集時に表示されます
ComboBoxCellType cbCell = new ComboBoxCellType()
{
    Items = new string[] { "要素1", "要素2", "要素3" },
    CssClass="mycombo1"
};
FpSpread1.Cells[0, 1].CellType = cbCell;

//コンボボックスを常に表示するよう設定します
ComboBoxCellType cbCell2 = new ComboBoxCellType()
{
    Items = new string[] { "要素1", "要素2", "要素3" },
    ShowButton = true,
    CssClass = "mycombo2"
};
FpSpread1.Cells[0, 2].CellType = cbCell2;
'コンボボックスは編集時に表示されます
Dim cbCell As New ComboBoxCellType() With {
    .Items = New String() {"要素1", "要素2", "要素3"},
    .CssClass = "mycombo1"
}
FpSpread1.Cells(0, 1).CellType = cbCell

'コンボボックスを常に表示するよう設定します
Dim cbCell2 As New ComboBoxCellType() With {
    .Items = New String() {"要素1", "要素2", "要素3"},
    .ShowButton = True,
    .CssClass = "mycombo2"
}
FpSpread1.Cells(0, 2).CellType = cbCell2
<!--スタイルシートでコンボボックスのフォントを設定します-->
<style type="text/css">
    .mycombo1 {font:bold large "MS 明朝";}
    .mycombo2 select{font:italic large "MS 明朝";}
</style>

 

 


© 2013-2015, GrapeCity inc. All rights reserved.