TextBox Constructeur

Définition

Initialise une nouvelle instance de la classe TextBox.

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

Exemples

L’exemple de code suivant crée une nouvelle instance du TextBox contrôle et affecte une chaîne à la propriété du Text contrôle.

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

Remarques

Le contrôle conteneur parent définit les paramètres de couleur et de police pour le TextBox.

S’applique à