TextBox.Multiline Özellik

Tanım

Bunun çok satırlı TextBox bir denetim olup olmadığını belirten bir değer alır veya ayarlar.

C#
public override bool Multiline { get; set; }

Özellik Değeri

true denetim çok satırlı TextBox bir denetimse; değilse, false. Varsayılan değer: false.

Örnekler

Aşağıdaki kod örneği, dikey kaydırma çubuklarıyla çok satırlı TextBox bir denetim oluşturur. Bu örnekte, çok satırlı metin kutusu denetiminin metin belgeleri oluştururken kullanışlı olmasını sağlamak için , AcceptsReturnve WordWrap özellikleri kullanılırAcceptsTab.

C#
public void CreateMyMultilineTextBox()
 {
    // Create an instance of a TextBox control.
    TextBox textBox1 = new TextBox();
       
    // Set the Multiline property to true.
    textBox1.Multiline = true;
    // Add vertical scroll bars to the TextBox control.
    textBox1.ScrollBars = ScrollBars.Vertical;
    // Allow the RETURN key to be entered in the TextBox control.
    textBox1.AcceptsReturn = true;
    // Allow the TAB key to be entered in the TextBox control.
    textBox1.AcceptsTab = true;
    // Set WordWrap to true to allow text to wrap to the next line.
    textBox1.WordWrap = true;
    // Set the default text of the control.
    textBox1.Text = "Welcome!";
 }

Açıklamalar

AutoCompleteSource çok satırlı TextBox denetimlerde çalışmaz.

Yazı tipi değiştirildiğinde, tanımladığınız girintiler görünmez. Girinti almak için, SETMARGINS'in çağrılmaması için true temel sınıfı çağırmadan WM_SETFONT olarak ayarlayın Multiline ve geçersiz kılın.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10