Halo semua pada hari ini saya share sedikit informasi aplikasi yang saya buat dengan windows form C# nama aplikasi nya adalah apk pemilihan kelas sks dengan coding yang sederhana.
form awalnya seperti ini
Yang perlu disiapkan adalah:
Textbox = 2
Radiobutton = 2
Listbox = 6
Checkbox = 6
Buttonbox = 1
Setelah itu masukin coding nya pada buttonboxnya dengan cara double klik ikutin lah coding yang ada dibawah
private void button1_Click(object sender, EventArgs e)
{
int b;
string a, c;
CheckBox[] chk = new CheckBox[6];
ListBox[] box = new ListBox[6];
a = “”;
b = 0;
chk[0] = checkBox1; box[0] = listBox1;
chk[1] = checkBox2; box[1] = listBox2;
chk[2] = checkBox3; box[2] = listBox3;
chk[3] = checkBox4; box[3] = listBox4;
chk[4] = checkBox5; box[4] = listBox5;
chk[5] = checkBox6; box[5] = listBox6;
if (radioButton1.Checked)
{
a = “pria”;
}
else if (radioButton2.Checked)
{
a = “wanita”;
}
else
{
MessageBox.Show(“anda belum isi data lengkap”,“data”,MessageBoxButtons.OK,MessageBoxIcon.Information);
}
for (b = 0; b < 6; b++)
{
if (chk[b].Checked)
{
box[b].Items.Add(“Nama: “ + textBox1.Text + “/NPM : “ + textBox2.Text + “/kelamin: “ + a);
}
}
}
Selesai jika ada kesalahan mohon maaf jika saya ada kesalahan boleh komentar sekian terima kasih