※ 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)
    {
        // 처리할 내용.
    }
}

+ Recent posts