0% found this document useful (0 votes)
2 views2 pages

lab_5 kim sir Department Select

The document is a C# code for a Windows Forms application that allows users to select a faculty and department. It includes radio buttons for faculty selection and updates a combo box based on the selected faculty. The selected faculty and department are then displayed in a text box when a button is clicked.

Uploaded by

MD. Nahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

lab_5 kim sir Department Select

The document is a C# code for a Windows Forms application that allows users to select a faculty and department. It includes radio buttons for faculty selection and updates a combo box based on the selected faculty. The selected faculty and department are then displayed in a text box when a button is clicked.

Uploaded by

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

Lab no: 05

Report Name: Faculty and Department select App.

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

namespace Nahid_029_Lab6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if(radioButton1.Checked)
{
comboBox1.DataSource = listBox1.Items;
}
if (radioButton2.Checked)
{
comboBox1.DataSource = listBox2.Items;
}
if (radioButton3.Checked)
{
comboBox1.DataSource = listBox3.Items;
}
}
private void button2_Click(object sender, EventArgs e)
{
if(radioButton1.Checked)
{
textBox1.Text = "Faculty: " + radioButton1.Text + Environment.NewLine
+"Department:"+ comboBox1.SelectedItem.ToString();
}
if (radioButton2.Checked)
{
textBox1.Text = "Faculty: " + radioButton2.Text + Environment.NewLine +
"Department:" + comboBox1.SelectedItem.ToString();
}
if (radioButton3.Checked)
{
textBox1.Text = "Faculty: " + radioButton3.Text + Environment.NewLine +
"Department: "+ comboBox1.SelectedItem.ToString();
}

}
}

Output:

You might also like