AWS の EC2 の Windows Server 2019 で
Visual Studio 2022 を使ってみました。
Label を 2個
Button を 4個
TextBox を 1個
配置します。
Visual Studio 2022 で編集
Label や Button をクリックすると、TextBox の表記が変わります。
プログラム
Form1.cs
namespace WinFormsApp_sep01
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
textBox1.Text = "4 seasons";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "Spring";
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "Summer";
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = "Autumn";
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = "Winter";
}
private void label2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
}
}
}