PowerTools InputMan for Windows Forms 8.0J
AcceptsReturn プロパティ
使用例 

複数行に設定したテキストコントロールでEnterキーを押したときに、コントロールのテキストを改行するのか、 またはフォームのAcceptButton プロパティに設定したボタンを 押下するのかを取得または設定します。
構文
Public Property AcceptsReturn As Boolean
public bool AcceptsReturn {get; set;}

プロパティ値

説明
True Enterキーが押下されたときに、複数行のテキストコントロールで改行します。
False Enterキーが押下されたときに、フォームのAcceptButton プロパティに設定したボタンを押下します。
既定値はFalseです。
解説
AcceptsReturn プロパティの値がFalse のときに複数行のテキストコントロールで改行するには、 Ctrlキーを押しながらEnterキーを押します。 フォームのAcceptButton プロパティに何も設定していない場合は、 AcceptsReturn プロパティの値に関係なく、Enterキーの押下だけで改行できます。
使用例
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void CreateMultilineGcTextBox()
{
    // Create an instance of a GcTextBox control.
    GcTextBox gcTextBox1 = new GcTextBox();

    // Set the Multiline property to true.
    gcTextBox1.Multiline = true;
    // Add vertical scroll bars to the GcTextBox control.
    gcTextBox1.ScrollBars = ScrollBars.Vertical;
    // Allow the RETURN key in the GcTextBox control.
    gcTextBox1.AcceptsReturn = true;
    // Allow the TAB key to be entered in the GcTextBox control.
    gcTextBox1.AcceptsTab = true;
    // Set WrapMode to WrapMode.WordWrap to allow text to wrap to the next line.
    gcTextBox1.WrapMode = GrapeCity.Win.Editors.WrapMode.WordWrap;
    // Set the default text of the control.
    gcTextBox1.Text = "Power Tools!" + Environment.NewLine + "This is the second line.";
}
'  Please use the following namespace
'  Imports System.Windows.Forms
'  Imports GrapeCity.Win.Editors

Public Sub CreateGcMultilineTextBox()
    ' Create an instance of a GcTextBox control.
    Dim gcTextBox1 As New GcTextBox()

    ' Set the Multiline property to true.
    gcTextBox1.Multiline = True
    ' Add vertical scroll bars to the GcTextBox control.
    gcTextBox1.ScrollBars = ScrollBars.Vertical
    ' Allow the RETURN key in the GcTextBox control.
    gcTextBox1.AcceptsReturn = True
    ' Allow the TAB key to be entered in the GcTextBox control.
    gcTextBox1.AcceptsTab = True
    ' Set WrapMode to WrapMode.WordWrap to allow text to wrap to the next line.
    gcTextBox1.WrapMode = GrapeCity.Win.Editors.WrapMode.WordWrap
    ' Set the default text of the control.
    gcTextBox1.Text = "Power Tools!" + Environment.NewLine + "This is the second line."
End Sub
参照

GcTextBox クラス
GcTextBox メンバ
Multiline プロパティ
ScrollBars プロパティ
AcceptsTab プロパティ
WrapMode プロパティ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.