-
Notifications
You must be signed in to change notification settings - Fork 0
4. CheckedListBox
sandeulsandeul edited this page May 11, 2020
·
1 revision
CheckedBox를 하나의 틀에 넣어서 사용하는 방법 속성의 기능을 사용해 내부에 포함하고 있는 CheckBox의 이름, 값 등을 변경할 수 있으며 새로운 CheckBox 생성이 가능하다.
SelectedIndexChanged 이벤트는 내부 CheckBox들이 선택 되었을 때 발생하는 이벤트
` namespace WindowsFormsApp2 { public partial class Form1 : Form {
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
checkedListBox1.Items.Add("기성용" + "\n");
checkedListBox1.Items.Add("손흥민" + "\n");
checkedListBox1.Items.Add("이승우" + "\n");
checkedListBox1.Items.Add("황희찬" + "\n");
checkedListBox1.Items.Add("조현우" + "\n");
checkedListBox1.Items.Add("김영권" + "\n");
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
MessageBox.Show("선수를 선택하였습니다.");
}
}
}
`