0% found this document useful (0 votes)
22 views

Using Using Using Using Namespace

This document is a C# program that uses combo boxes and events. It contains code for a main form with combo boxes that populate each other based on selection. When the first combo box selection changes, the second combo box is cleared and populated with options related to the first selection. For example, if "Jurusan" is selected, the second will include course options.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Using Using Using Using Namespace

This document is a C# program that uses combo boxes and events. It contains code for a main form with combo boxes that populate each other based on selection. When the first combo box selection changes, the second combo box is cleared and populated with options related to the first selection. For example, if "Jurusan" is selected, the second will include course options.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Pemrogaman Lanjut

TUGAS 1
AHMAD FAUZAN ZAKARIA
15183207044
PENDIDIKAN TEKNOLOGI INFORMASI
/*
* Created by SharpDevelop.
* User: A. FAUZAN ZAKARIA
* Date: 3/7/2017
* Time: 10:55 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace bab4
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
{
comboBox2.Items.Clear();
if(comboBox1.SelectedItem =="Jurusan")
{
comboBox2.Items.Add("Pendidikan Teknologi Informasi");
comboBox2.Items.Add("Ekonomi");
comboBox2.Items.Add("PGSD");
comboBox2.SelectedItem="Pendidikan Teknologi Informasi";
}
else
{
if(comboBox1.SelectedItem =="Mata Kuliah")
{
comboBox2.Items.Add("Pemrograman");
comboBox2.Items.Add("Sistem operasi");
comboBox2.Items.Add("Komputer Jaringan");
comboBox2.Items.Add("Elearning");
comboBox2.SelectedItem="Pemrograman";
}
else
{
if(comboBox1.SelectedItem =="Nama");
{
comboBox2.Items.Add("Ahmad Fauzan Zakaria");
comboBox2.Items.Add("Alex");
comboBox2.Items.Add("Dicky");
comboBox2.Items.Add("Nanda");
comboBox2.SelectedItem="Ahmad Fauzan Zakaria";
}
}
}
}

void ComboBox2SelectedIndexChanged(object sender, EventArgs e)


{

void MainFormLoad(object sender, EventArgs e)


{
comboBox1.Items.Add("Jurusan");
comboBox1.Items.Add("Mata Kuliah");
comboBox1.Items.Add("Nama");
}

void Label1Click(object sender, EventArgs e)


{

}
}
}
“OUTPUT”

You might also like