Question: using System; using System.Windows.Forms; namespace LoginFormApp { public partial class Form 1 : Form { public Form 1 ( ) { InitializeComponent ( ) ;
using System;
using System.Windows.Forms;
namespace LoginFormApp
public partial class Form : Form
public Form
InitializeComponent;
Populate the gender ComboBox
comboBoxGender.Items.AddMale;
comboBoxGender.Items.AddFemale;
comboBoxGender.Items.AddOther;
private void buttonSubmitClickobject sender EventArgs e
Validate and process the input
string name textBoxName.Text.Trim;
string surname textBoxSurname.Text.Trim;
string gender comboBoxGender.SelectedItem as string;
if stringIsNullOrEmptyname string.IsNullOrEmptysurname string.IsNullOrEmptygender
MessageBox.ShowPlease fill in all fields.", "Error", MessageBoxButtons.OK MessageBoxIcon.Error;
else
Display a welcome message
string welcomeMessage $"Welcome, namesurname Gender: gender;
MessageBox.ShowwelcomeMessage "Welcome", MessageBoxButtons.OK MessageBoxIcon.Information;
Clear the form after submission
textBoxName.Clear;
textBoxSurname.Clear;
comboBoxGender.SelectedIndex ;
check this code and screenshots needed
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
