0% found this document useful (0 votes)
3 views1 page

Exercice1

This document contains a C# Windows Forms application for student registration. It initializes dropdowns for day, month, and year during form load and displays the entered student information in a message box upon validation. The application captures the student's name, surname, birth date, and gender.

Uploaded by

fofackrayol
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)
3 views1 page

Exercice1

This document contains a C# Windows Forms application for student registration. It initializes dropdowns for day, month, and year during form load and displays the entered student information in a message box upon validation. The application captures the student's name, surname, birth date, and gender.

Uploaded by

fofackrayol
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/ 1

using System;

using System.Windows.Forms;

namespace StudentRegistrationApplication
{
public partial class frmStudentRegistration : Form
{
public frmStudentRegistration()
{
InitializeComponent();
}

private void frmStudentRegistration_Load(object sender, EventArgs e)


{
for (int i = 1; i <= 31; i++)
{
cmbJour.Items.Add(i);
}

for (int i = 1; i <= 12; i++)


{
cmbMois.Items.Add(i);
}

for (int i = 1900; i <= DateTime.Now.Year; i++)


{
cmbAnnee.Items.Add(i);
}
}

private void btnValider_Click(object sender, EventArgs e)


{
string nom = txtNom.Text;
string prenom = txtPrenom.Text;
string jour = cmbJour.SelectedItem?.ToString() ?? "N/A";
string mois = cmbMois.SelectedItem?.ToString() ?? "N/A";
string annee = cmbAnnee.SelectedItem?.ToString() ?? "N/A";
string genre = radHomme.Checked ? "Homme" : "Femme";

string message = "Nom: " + nom + Environment.NewLine +


"Prénom: " + prenom + Environment.NewLine +
"Date de naissance: " + jour + "/" + mois + "/" +
annee + Environment.NewLine +
"Genre: " + genre;

MessageBox.Show(message, "Inscription des étudiants");


}
}
}

You might also like