2. TEXTBOX - sandeulsandeul/let-s-learning-C-winForm- GitHub Wiki

`using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

namespace WindowsFormsApp2 { public partial class Form1 : Form {

    public Form1()
    {
        /*public Form1 ์ด๋ผ๋Š” ์ฐฝ ํ™”๋ฉด์„ 
          InitializeComponent();ํ•จ์ˆ˜๋ฅผ ์ ์šฉํ•ด
          ๋””์ž์ธํ•œ ํ™”๋ฉด์œผ๋กœ์ ์šฉ*/
        InitializeComponent();

        /*button1์ด ํด๋ฆญ๋˜์—ˆ์„ ๋•Œ button_Click() ํ•จ์ˆ˜ ์ ์šฉ */
        this.button1.Click += new System.EventHandler(this.button1_Click_1);

       

    }

    /*private (ํด๋ž˜์Šค ๋‚ด์—์„œ๋งŒ ์ ‘๊ทผ ๊ฐ€๋Šฅ )๋กœ button1_Click ํ•จ์ˆ˜ ์ƒ์„ฑ*/

    private void button1_Click_1(object sender, EventArgs e)
    {
        /*MessageBox์˜ Show ์‚ฌ์šฉํ•ด Hello World ์ถœ๋ ฅ */
        MessageBox.Show("Hello World");
    }

    private void Form1_Load_1( object sender, EventArgs e)
    {
        //TextBox์— ์ดˆ๊ธฐ๊ฐ’ ํ• ๋‹น
        textBox1.Text = "์„œ์šธํŠน๋ณ„์‹œ ์˜๋“ฑํฌ๊ตฌ ์‹ ๊ธธ๋™ 123๋ฒˆ์ง€";

        StringBuilder sb = new StringBuilder();
        sb.AppendLine("์ด๋ฆ„ : ํ™๊ธธ๋™");
        sb.AppendLine("๋‚˜์ด : 27์„ธ");
        sb.AppendLine("๊ตญ์  : ํ•œ๊ตญ");
        textBox2.Text = sb.ToString();

        /*์ตœ๋Œ€ ๊ธธ์ด ์ง€์ •*/
        textBox3.MaxLength = 10;
        /*์ฝ๊ธฐ๋งŒ ๊ฐ€๋Šฅ */
        textBox4.ReadOnly = true;
        /* PasswordChar ๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ฐ›๋Š”๋‹ค*/
        textBox5.PasswordChar = '*'; 

        textBox3.Text = "์„œ์šธํŠน๋ณ„์‹œ ์˜๋“ฑํฌ๊ตฌ ์‹ ๊ธธ๋™ 123๋ฒˆ์ง€";
        textBox4.Text = "์„œ์šธํŠน๋ณ„์‹œ ์˜๋“ฑํฌ๊ตฌ ์‹ ๊ธธ๋™ 123๋ฒˆ์ง€";
        textBox5.Text = "์„œ์šธํŠน๋ณ„์‹œ ์˜๋“ฑํฌ๊ตฌ ์‹ ๊ธธ๋™ 123๋ฒˆ์ง€";
    }
}

} `