Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PENGGUNAAN BERBAGAI OBJEK DALAM TOOLS SHARP DEVELOP

( COMBOBOX, RADIO BUTTON, CHECK BOX, DATE TIME PICKER)

LISTING PROGRAM :

void Button1Click(object sender, EventArgs e)


{
listBox1.Items.Add (" IDENTITAS MAHASISWA ");
listBox1.Items.Add (" Nim : " +textBox1.Text);
listBox1.Items.Add (" Nama Mahasiswa : " + textBox2.Text);
listBox1.Items.Add (" Jurusan : " + comboBox1.SelectedItem);
listBox1.Items.Add (" Tempat Lahir " + textBox3.Text);
listBox1.Items.Add ("Tanggal Lahir : " + dateTimePicker1.Text);
listBox1.Items.Add ("Agama : " + comboBox2.SelectedItem);
if (radioButton1.Checked == true )
{
listBox1.Items.Add ( "jenis Kelamin : "+ radioButton1.Text);
}
else if (radioButton2.Checked == true )
{
listBox1.Items.Add ( "jenis Kelamin : "+radioButton2.Text);
}

listBox1.Items.Add (" Alamat : " + textBox4.Text);


if ( checkBox1.Checked == true )
{
listBox1.Items.Add (" hobby " + checkBox1.Text);
}
if ( checkBox2.Checked == true )
{
listBox1.Items.Add (" hobby " + checkBox2.Text);
}
if ( checkBox3.Checked == true )
{
listBox1.Items.Add (" hobby " + checkBox3.Text);
}

public MainForm()
{

//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
comboBox1.Items.Add ("SISTEM INFORMASI (S1)");
comboBox1.Items.Add ("TEKNIK INFORMATIKA (S1)");
comboBox1.Items.Add ("MANAJEMEN INFORMATIKA (D3)");

You might also like