Ejemplo n.º 1
0
        private void CancelBtn_Click(object sender, EventArgs e)
        {
            DisplayRichTxBx.Clear();
            FirstNameTxBx.Clear();
            LastNameTxBx.Clear();

            BirthdayDatePicker.Value = DateTime.Now;

            foreach (RadioButton r in GenderGrpBx.Controls)
            {
                r.Checked = false;
            }

            foreach (RadioButton r in BranchesGrpBx.Controls)
            {
                r.Checked = false;
            }

            foreach (CheckBox cb in HobbiesGrpBx.Controls)
            {
                cb.Checked = false;
            }

            foreach (int i in DegreeCheckListBx.CheckedIndices)
            {
                DegreeCheckListBx.SetItemCheckState(i, CheckState.Unchecked);
            }
        }
Ejemplo n.º 2
0
        private void SendBtn_Click(object sender, EventArgs e)
        {
            if (DisplayRichTxBx.Text != "")
            {
                DisplayRichTxBx.Text += "\n===============================\n\n";
            }

            DisplayRichTxBx.Text += "Bonjour ::> ";
            DisplayRichTxBx.Text += string.Join(" ", FirstNameTxBx.Text, LastNameTxBx.Text);
            DisplayRichTxBx.Text += "\n";

            DisplayRichTxBx.Text += $"Date de naissance ::> {BirthdayDatePicker.Value.ToString("d")}";
            DisplayRichTxBx.Text += "\n";

            string g = "";

            foreach (RadioButton r in GenderGrpBx.Controls)
            {
                if (r.Checked)
                {
                    g = r.Text;
                }
            }
            DisplayRichTxBx.Text += $"Sexe ::> {g}";
            DisplayRichTxBx.Text += "\n";

            string b = "";

            foreach (RadioButton r in BranchesGrpBx.Controls)
            {
                if (r.Checked)
                {
                    b = r.Text;
                }
            }
            DisplayRichTxBx.Text += $"Branche ::> {b}";
            DisplayRichTxBx.Text += "\n";

            string h = "";

            foreach (CheckBox cb in HobbiesGrpBx.Controls)
            {
                if (cb.Checked)
                {
                    h += $"{cb.Text}; ";
                }
            }
            DisplayRichTxBx.Text += $"Loisirs ::> {h}";
            DisplayRichTxBx.Text += "\n";

            DisplayRichTxBx.Text += $"Diplomes ::> ({DegreeCheckListBx.CheckedIndices.Count})";
            string d = "";

            for (int i = 0; i < DegreeCheckListBx.Items.Count; i += 1)
            {
                if (DegreeCheckListBx.GetItemChecked(i))
                {
                    d += $"{DegreeCheckListBx.Items[i]}; ";
                }
            }

            DisplayRichTxBx.Text += $"{d}";
            DisplayRichTxBx.Text += "\n";
        }