※ Radio버튼의 상태가 변경된 상태의 이벤트인 CheckedChanged 이벤트가 있습니다.
2개의 버튼이 있고 1번째가 체크되어 있는 상태일 때, 2번째 버튼을 클릭하면
1번째 버튼의 상태가 변경, 2번째 버튼이 체크 => 총 2번의 이벤트가 실행됩니다.
그래서 이벤트에 아래와 같이 처리합니다.
this.rdoTest1.CheckedChanged += rdoTest_CheckedChanged;
this.rdoTest2.CheckedChanged += rdoTest_CheckedChanged;
this.rdoTest3.CheckedChanged += rdoTest_CheckedChanged;
private void rdoTest_CheckedChanged(object sender, EventArgs e)
{
if ((sender as RadioButton).Checked)
{
// 처리할 내용.
}
}
'C#' 카테고리의 다른 글
[C#] CSV형태의 레포트 만들기2(다중 데이터) (0) | 2025.02.22 |
---|---|
[C#] CSV형태의 레포트 만들기2(단일 데이터) (0) | 2025.02.18 |
[C#] OpenFileDialog, SaveFileDialog 사용방법 (0) | 2025.02.15 |
[C#] DateTimePicker 값 설정 (0) | 2025.02.13 |
[C#] IronOCR 사용후기 (1) | 2025.02.12 |