Database Reference
In-Depth Information
lstCountry.Items.Remove(lstCountry.SelectedItem);
cboState.Items.Remove(cboState.SelectedItem);
Now for the Show Details button, you have used some conditional logic to produce different
message based on your selection, specifically with the Male and Female radio buttons.
The CheckBox and RadioButton controls offer a property named Checked, which can be either true
or false, that is, checked or not checked. You build a condition around these and then show a message
box.
if (chkEmail.Checked == true || chkPostalMail.Checked == true &&
rdbMale.Checked == true)
{
MessageBox.Show("Hello Mr, you will be contacted by either USPS or
email", "Information",MessageBoxButtons.OKCancel,
MessageBoxIcon.Information);
}
else
if (chkEmail.Checked == true || chkPostalMail.Checked == true &&
rdbFemale.Checked == true)
{
MessageBox.Show("Hello Mam, you will be contacted by either USPS or
email", "Information", MessageBoxButtons.OKCancel,
MessageBoxIcon.Information);
}
In the “Setting the Startup Form” task, you create an instance of the AddName form in the
Program.cs file, as shown in the following code:
Application.Run(new UserInfo());
Implementing an MDI Form
The term multiple document interface (MDI) means to have a GUI interface that allows multiple
documents or forms under one parent form or window.
Visualize the working style of Microsoft Word: you are allowed to open multiple documents in one
parent window, and all the documents will get listed in the Window menu, from which you can choose
whichever you want to read, instead of having the individual documents open in their own windows,
which makes it difficult to handle all of the documents and covers your screen with a lot of open
windows.
Having an individual window for each instance of the same application is termed single document
interface (SDI); applications such as Notepad, MS Paint, Calculator, and so on, are SDI applications. SDI
applications get opened only in their own windows and can become difficult to manage, unlike when
you have multiple documents or forms open inside one MDI interface.
Hence, MDI applications follow a parent form and child form relationship model. MDI applications
allow you to open, organize, and work with multiple documents at the same time by opening them
under the context of the MDI parent form; therefore, once opened, they can't be dragged out of it like an
individual form.
The parent (MDI) form organizes and arranges all the child forms or documents that are currently
open. You might have seen such options in many Windows applications under a Windows menu, such
as Cascade, Tile Vertical, and so on.
 
Search WWH ::




Custom Search