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

Using Using Using Using Using Using Using Using Namespace Public Partial Class Public

The document contains C# code that defines a Windows form with three cascading combo boxes. The first combo box populates the second, and the second populates the third, with options for different geographic regions and locations. The code handles the SelectedIndexChanged events for each combo box to dynamically populate the next one. Other form elements like checkboxes, textboxes, and buttons are used to display selected values.

Uploaded by

MóNoóVanegasG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Using Using Using Using Using Using Using Using Namespace Public Partial Class Public

The document contains C# code that defines a Windows form with three cascading combo boxes. The first combo box populates the second, and the second populates the third, with options for different geographic regions and locations. The code handles the SelectedIndexChanged events for each combo box to dynamically populate the next one. Other form elements like checkboxes, textboxes, and buttons are used to display selected values.

Uploaded by

MóNoóVanegasG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace primer_trabajo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void comboBox1_SelectedIndexChanged(object sender,


EventArgs e)
{
comboBox2.Items.Clear();
switch (comboBox1.SelectedIndex)
{
case 0:
comboBox2.Items.Add("Antioquia");
comboBox2.Items.Add("Bogotá D.C");
comboBox2.Items.Add("Boyaca");
comboBox2.Items.Add("Caldas");
comboBox2.Items.Add("Cundinamarca");
comboBox2.Items.Add("otro");

break;

case 1:
comboBox2.Items.Add("Carabobo");
comboBox2.Items.Add("Distrito capital");
comboBox2.Items.Add("Miranda");
comboBox2.Items.Add("Tachira");
comboBox2.Items.Add("Trujillo");
comboBox2.Items.Add("otro");

break;

case 2:
comboBox2.Items.Add("Minas Gerais");
comboBox2.Items.Add("Paraná");
comboBox2.Items.Add("Rio de Janeiro");
comboBox2.Items.Add("Rio Grande del Sur");
comboBox2.Items.Add("Sao Pablo");
comboBox2.Items.Add("otro");

break;

case 3:
comboBox2.Items.Add("Antofagasta");
comboBox2.Items.Add("Los Lagos");
comboBox2.Items.Add("Metropolitana de Santiago");
comboBox2.Items.Add("Tarapacá");
comboBox2.Items.Add("Valparaíso");
comboBox2.Items.Add("otro");

break;

case 4:
comboBox2.Items.Add("Buenos Aires");
comboBox2.Items.Add("Chaco");
comboBox2.Items.Add("Córdoba");
comboBox2.Items.Add("Mendoza");
comboBox2.Items.Add("Santa Fe");
comboBox2.Items.Add("otro");

break;
}
}

private void comboBox2_SelectedIndexChanged(object sender,


EventArgs e)
{
comboBox3.Items.Clear();
switch (comboBox2.SelectedIndex)
{
case 0:
comboBox3.Items.Add("Bello");
comboBox3.Items.Add("Envigado");
comboBox3.Items.Add("itaguí");
comboBox3.Items.Add("Jumbo");
comboBox3.Items.Add("Medellin");
comboBox3.Items.Add("otro");

break;

case 1:
comboBox3.Items.Add("Candelaria");
comboBox3.Items.Add("Chapinero");
comboBox3.Items.Add("San Cristobal");
comboBox3.Items.Add("Santa Fe");
comboBox3.Items.Add("Teusaquillo");
comboBox3.Items.Add("otro");

break;

case 2:
comboBox3.Items.Add("Duitama");
comboBox3.Items.Add("Chiquinquira");
comboBox3.Items.Add("Chita");
comboBox3.Items.Add("Villa de Leiva");
comboBox3.Items.Add("Tunja");
comboBox3.Items.Add("otro");

break;
case 3:
comboBox3.Items.Add("Honda");
comboBox3.Items.Add("Manizales");
comboBox3.Items.Add("Pensilvania");
comboBox3.Items.Add("Rio Sucio");
comboBox3.Items.Add("Risaralda");
comboBox3.Items.Add("otro");

break;

case 4:
comboBox3.Items.Add("Facá");
comboBox3.Items.Add("Girardot");
comboBox3.Items.Add("Sutatausa");
comboBox3.Items.Add("Tocaima");
comboBox3.Items.Add("Tocancipá");
comboBox3.Items.Add("otro");

break;
}
}

private void button3_Click(object sender, EventArgs e)


{
MessageBox.Show(checkBox1. + " " + checkBox2.Checked + " " +
checkBox3.Checked + " " + checkBox4.Checked);

private void button4_Click_1(object sender, EventArgs e)


{
MessageBox.Show(checkBox5.Checked + " " +
radioButton1.Capture + " " + textBox4.Text + " " +
comboBox2.SelectedItem);
panel4.Visible = false;
}

private void button1_Click(object sender, EventArgs e)


{
MessageBox.Show(textBox1.Text + " " + textBox2.Text + " " +
textBox3.Text);
}

private void button2_Click_1(object sender, EventArgs e)


{
MessageBox.Show(comboBox1.SelectedItem + " " +
comboBox2.SelectedItem + " " + comboBox3.SelectedItem);
panel4.Visible = true;
}

}
}

You might also like