Friday, August 9, 2024

Create a simple WinForms application



Create a simple WinForms application with a form that has a `TextBox`, a `Button`, and a `Label`. When the button is clicked, the text entered in the `TextBox` should be displayed in the `Label`.

1. Create a new WinForms project.
2. Add a `TextBox`, a `Button`, and a `Label` to the form.
3. Double-click the button to generate a click event handler.
4. In the event handler, set the `Label`'s text to the `TextBox`'s text.

```csharp
private void button1_Click(object sender, EventArgs e)
{
    label1.Text = textBox1.Text;
}

No comments:

Your Title