TextBox TextBox TextBox Constructor

정의

TextBox 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the TextBox class.

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

예제

다음 코드 예제에서는의 새 인스턴스를 만듭니다는 TextBox 컨트롤을 컨트롤에 문자열을 할당 Text 속성입니다.The following code example creates a new instance of the TextBox control and assigns a string to the control's Text property.

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

설명

부모 컨테이너 컨트롤에 대 한 색 및 글꼴 설정을 정의 합니다 TextBox합니다.The parent container control defines the color and font settings for the TextBox.

적용 대상