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

Codestudentregistration

The document defines a Windows Forms application for student registration. It contains code to populate dropdown lists for days, months, years and degree programs. When the registration button is clicked, it displays the student's first name, middle name, last name, gender, date of birth and degree program in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Codestudentregistration

The document defines a Windows Forms application for student registration. It contains code to populate dropdown lists for days, months, years and degree programs. When the registration button is clicked, it displays the student's first name, middle name, last name, gender, date of birth and degree program in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System;

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

namespace STUDENTREGISTRATION
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ArrayListClass();
TwoDimensional();

for (int days = 1; days <= 31; days++)


{
comboBox1.Items.Add(days);
}

for (int year = 1990; year <= 2030; year++)


{
comboBox3.Items.Add(year);
}
}
private void ArrayListClass()
{
ArrayList list = new ArrayList();
list.Add("Bachelor of Science in Computer Science");
list.Add("Bachelor of Science in Information Technology");
list.Add("Bachelor of Science in Information Systems");
list.Add("Bachelor of Science in Computer Engineering");
comboBox4.DataSource = list;
comboBox4.SelectedIndex = 0;
}
private void TwoDimensional()
{
string[,] months = {{"January","February","March","April",
"May","June","July", "August", "September",
"October","November","December" } };
foreach (string month in months)
{
comboBox2.Items.Add(month);
}
}
private void button1_Click(object sender, EventArgs e)
{
string LN = textBox1.Text;
string FN = textBox2.Text;
string MN = textBox3.Text;
String gender;
int DAY = comboBox1.SelectedIndex;
int MONTH = comboBox2.SelectedIndex;
int YEAR = comboBox3.SelectedIndex;
string PROGRAM = comboBox4.Text;

if (radioButton1.Checked)
{
gender = "Male";
}
else
gender = "Female";

MessageBox.Show("Student Name: " + FN + " " + MN + " " + LN


+ "\n" + "Gender: " + gender + "\n" +
"Date of birth: " + DAY + "/" + MONTH + "/" + YEAR +
"\n"
+ "Program: " + PROGRAM
);
}
}
}

You might also like