PowerTools MultiRow for Windows Forms 8.0J
Format プロパティ (GcTextBoxCell)
使用例 

セルで使用する入力書式を取得または設定します。
構文
Public Property Format As String
public string Format {get; set;}

プロパティ値

セルにどのようなテキストを入力できるかを示す文字列。
使用例
以下は書式設定を行うサンプルコードです。このコードはGcTextBoxCell のサンプルコードの一部です。
private void Form1_Load(object sender, EventArgs e)
{
    // Create an instance of a GcTextBox control.
    GcTextBoxCell gcTextBoxCell1 = new GcTextBoxCell();
    // Accept upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars.
    gcTextBoxCell1.Format = @"aA@^\#\@*";
    // The GcTextBox will try to convert the invalid char to valid char automatically.
    gcTextBoxCell1.AutoConvert = true;

    DropDownButton dropDownButton1 = new DropDownButton();
    dropDownButton1.Visible = CellButtonVisibility.ShowForCurrentCell;
    gcTextBoxCell1.SideButtons.Add(dropDownButton1);

    //Hit the "F6" to switch the DropDownList.
    gcTextBoxCell1.ShortcutKeys.Add(Keys.F6, "SwitchDropDown");

    Template template1 = Template.CreateGridTemplate(new Cell[] { gcTextBoxCell1, gcTextBoxCell1.Clone() as Cell }, 160,
        AutoGenerateGridTemplateStyles.ColumnHeader | AutoGenerateGridTemplateStyles.RowHeaderAutoNumber);

    gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 3;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    ' Create an instance of a GcTextBox control.
    Dim gcTextBoxCell1 As New GcTextBoxCell()
    ' Accept upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars.
    gcTextBoxCell1.Format = "aA@^\#\@*"
    ' The GcTextBox will try to convert the invalid char to valid char automatically.
    gcTextBoxCell1.AutoConvert = True

    Dim dropDownButton1 As New DropDownButton()
    dropDownButton1.Visible = CellButtonVisibility.ShowForCurrentCell
    gcTextBoxCell1.SideButtons.Add(dropDownButton1)

    'Hit the "F6" to switch the DropDownList.
    gcTextBoxCell1.ShortcutKeys.Add(Keys.F6, "SwitchDropDown")

    Dim template1 As Template = Template.CreateGridTemplate(New Cell() {gcTextBoxCell1, TryCast(gcTextBoxCell1.Clone(), Cell)}, 160, AutoGenerateGridTemplateStyles.ColumnHeader Or AutoGenerateGridTemplateStyles.RowHeaderAutoNumber)

    gcMultiRow1.Template = template1
    gcMultiRow1.RowCount = 3
End Sub
参照

GcTextBoxCell クラス
GcTextBoxCell メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.