PowerTools CalendarGrid for Windows Forms 1.0J
Ellipsis プロパティ (CalendarComboBoxCellType)
使用例 

表示テキストの幅がセルの内容境界の幅より大きい場合に省略記号をどのように表示するかを取得または設定します。
構文
Public Property Ellipsis As CalendarGridEllipsisMode
public CalendarGridEllipsisMode Ellipsis {get; set;}

プロパティ値

CalendarGridEllipsisMode 値の 1 つ。既定値は CalendarGridEllipsisMode.None です。
例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値が CalendarGridEllipsisMode 値の 1 つではありません。
解説
このプロパティは EllipsisString と組み合わせて使用します。
使用例
次のサンプルコードは、ComboBox 型セルの動作または外観をカスタマイズする方法を示します。このサンプルコードは、CalendarComboBoxCellType クラスに示されている詳細なコード例の一部を抜粋したものです。
CalendarComboBoxCellType CreateCommonComboBoxCell()
{
    CalendarComboBoxCellType comboBoxCell = new CalendarComboBoxCellType();

    // The item which listed in drop down window. 
    comboBoxCell.Items.Add("Item2");
    comboBoxCell.Items.Add("Item1");
    comboBoxCell.Items.Add("Item3");
    comboBoxCell.Items.Add("Item4");
    comboBoxCell.Items.Add("Long Item to Make Ellipsis Show");

    // Sort items.
    comboBoxCell.Sorted = true;

    // Drop down window's width, in default, the value is equals to cell's width.
    comboBoxCell.DropDownWidth = 100;

    // In non edit status, if text's length bigger than cell's width, EllipsisString will be shown.
    comboBoxCell.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd;

    return comboBoxCell;
}
Private Function CreateCommonComboBoxCell() As CalendarComboBoxCellType
    Dim comboBoxCell As New CalendarComboBoxCellType()

    ' The item which listed in drop down window. 
    comboBoxCell.Items.Add("Item2")
    comboBoxCell.Items.Add("Item1")
    comboBoxCell.Items.Add("Item3")
    comboBoxCell.Items.Add("Item4")
    comboBoxCell.Items.Add("Long Item to Make Ellipsis Show")

    ' Sort items.
    comboBoxCell.Sorted = True

    ' Drop down window's width, in default, the value is equals to cell's width.
    comboBoxCell.DropDownWidth = 100

    ' In non edit status, if text's length bigger than cell's width, EllipsisString will be shown.
    comboBoxCell.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd

    Return comboBoxCell
End Function
参照

CalendarComboBoxCellType クラス
CalendarComboBoxCellType メンバ
EllipsisString プロパティ

 

 


© 2014 GrapeCity inc. All rights reserved.