TextBox Constructor

Definitie

Initialiseert een nieuw exemplaar van de TextBox klasse.

public:
 TextBox();
public TextBox();
Public Sub New ()

Voorbeelden

In het volgende codevoorbeeld wordt een nieuw exemplaar van het TextBox besturingselement gemaakt en wordt een tekenreeks toegewezen aan de eigenschap van Text het besturingselement.

public:
   void CreateMyTextBoxControl()
   {
      // Create a new TextBox control using this constructor.
      TextBox^ textBox1 = gcnew TextBox;
      // Assign a string of text to the new TextBox control.
      textBox1->Text = "Hello World!";
      // Code goes here to add the control to the form's control collection.
   }
public void CreateMyTextBoxControl()
 {
    // Create a new TextBox control using this constructor.
    TextBox textBox1 = new TextBox();
    // Assign a string of text to the new TextBox control.
    textBox1.Text = "Hello World!";
    // Code goes here to add the control to the form's control collection.
 }
Public Sub CreateMyTextBoxControl()
    ' Create a new TextBox control using this constructor.
    Dim textBox1 As New TextBox()
    ' Assign a string of text to the new TextBox control.
    textBox1.Text = "Hello World!"

    ' Code goes here to add the control to the form's control collection.
End Sub

Opmerkingen

Het bovenliggende container besturingselement definieert de kleur- en lettertype-instellingen voor de TextBox.

Van toepassing op