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 Event_Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// 1. Event가 발생 시 어떤 것을 실행할지 정해둔 Method 생성
public void Test_Label_Change(object sender, EventArgs e)
{
Test_Label.Text = "C# Event Study";
}
// 2. 생성한 Method를 EventHandler(Method Name) 등록
private void Form1_Load(object sender, EventArgs e)
{
this.Click += new EventHandler(Test_Label_Change);
}
}
}
Form1 클릭 시
'C# 개인 공부 기록용 > Memo' 카테고리의 다른 글
NuGet restore 오류 해결 방법 (2) | 2023.03.09 |
---|---|
윈폼 디자인 꾸미기 (0) | 2022.11.22 |
UI 둥글게 만들기 (0) | 2022.08.19 |
C# Spreadsheet 도구 상자에 추가하는 방법 (0) | 2022.08.02 |
C# SpreadSheet를 Excel 파일로 저장하는 방법 (0) | 2022.07.26 |