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

オペレーティングシステムによって提供されるパスワード文字を使用するかどうかを示す値を取得または設定します。
構文
Public Property UseSystemPasswordChar As Boolean
public bool UseSystemPasswordChar {get; set;}

プロパティ値

システムのパスワード文字を使用する場合は true。それ以外の場合は false。既定値は false です。
解説
UseSystemPasswordChar プロパティは、ユーザーがセルに入力した文字を、オペレーティングシステムで定義されたパスワード文字に置き換えて表示するかどうかを決定します。このプロパティは、PasswordChar よりも優先されます。

重要:
セキュリティ上の理由から、CalendarTextBoxCellType では、パスワード保護された文字列の切り取りおよびコピー操作はできません。

使用例
次のサンプルコードは、TextBoxCell のいくつかの重要なプロパティを示します。セルにテキスト全体を表示できない場合、省略記号文字列 "......" が表示されます。HighlightText プロパティが true に設定されているため、編集モードに入るとテキストが選択されます。MaxLength は 10 なので、元のテキストを削除してテキストを入力する場合、10 文字だけ入力できます。大文字のテキストは小文字に変換されます。このサンプルコードは、CalendarTextBoxCellType クラスに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    CalendarTextBoxCellType textBoxCell1 = new CalendarTextBoxCellType();
    //If the text cannot display completely, one '......' string will be shown at the text's end, hover the cell, the whole text will be shown in tool tip.
    textBoxCell1.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd;
    textBoxCell1.EllipsisString = "......";
    //Enter the edit mode, the text will be highlight selected.
    textBoxCell1.HighlightText = true;
    textBoxCell1.MaxLength = 10;
    //The value will be casted to lower case.
    textBoxCell1.CharacterCasing = CharacterCasing.Lower;

    CalendarTextBoxCellType textBoxCell2 = new CalendarTextBoxCellType();
    //Input text in textBoxCell2, it will be treated as password, always display '#'.
    textBoxCell2.PasswordChar = '#';
    textBoxCell2.UseSystemPasswordChar = false;

    CalendarTemplate template1 = CalendarTemplate.CreateDefaultTemplate();
    template1.Content[1, 0].CellType = textBoxCell1;
    template1.Content[1, 0].Value = "DELETE THIS STRING TO INPUT BY YOURSELF, ONLY 10 CHARACTERS CAN BE INPUT";
    template1.Content[2, 0].CellType = textBoxCell2;
    template1.Content[2, 0].Value = "12345";

    gcCalendarGrid1.Template = template1;
}
Private Sub Form1_Load(sender As Object, e As EventArgs)
    Dim textBoxCell1 As New CalendarTextBoxCellType()
    'If the text cannot display completely, one '......' string will be shown at the text's end, hover the cell, the whole text will be shown in tool tip.
    textBoxCell1.Ellipsis = CalendarGridEllipsisMode.EllipsisEnd
    textBoxCell1.EllipsisString = "......"
    'Enter the edit mode, the text will be highlight selected.
    textBoxCell1.HighlightText = True
    textBoxCell1.MaxLength = 10
    'The value will be casted to lower case.
    textBoxCell1.CharacterCasing = CharacterCasing.Lower

    Dim textBoxCell2 As New CalendarTextBoxCellType()
    'Input text in textBoxCell2, it will be treated as password, always display '#'.
    textBoxCell2.PasswordChar = "#"c
    textBoxCell2.UseSystemPasswordChar = False

    Dim template1 As CalendarTemplate = CalendarTemplate.CreateDefaultTemplate()
    template1.Content(1, 0).CellType = textBoxCell1
    template1.Content(1, 0).Value = "DELETE THIS STRING TO INPUT BY YOURSELF, ONLY 10 CHARACTERS CAN BE INPUT"
    template1.Content(2, 0).CellType = textBoxCell2
    template1.Content(2, 0).Value = "12345"

    gcCalendarGrid1.Template = template1
End Sub
参照

CalendarTextBoxCellType クラス
CalendarTextBoxCellType メンバ

 

 


© 2014 GrapeCity inc. All rights reserved.