MCC - CIS162AD
CS14 Additional Controls - 20 Extra Credit points
|
|
Create a Multiple Document Interface (MDI) project that includes a Toolbar, Status Bar,
and Calendar controls.
Sample Form:
Outline to complete project:
- Create a new project (CS14).
- Create 3 forms (MainForm, Child1Form, Child2Form).
- On MainForm set IsMdiContainer property to True.
- Add a MenuStrip to MainForm that includes the options Exit (mnuExit) and Window (mnuWindow).
- Click on menuStrip1 once to select, and set the MdiWindowListItem property to mnuWindow.
- Exit should close the application (this.Close).
- The Window menu item should include the options to Tile Horizontally and Cascade Windows.
Use the LayoutMdi method in each event procedure to set the type of layout:
this.LayoutMdi(MdiLayout.TileHorizontal);
this.LayoutMdi(MdiLayout.Cascade);
- Add a ToolStrip control (toolStrip1) to MainForm.
- Add 2 Buttons (tbbChild1, tbbchild2) using the Add ToolStripButton dropdown list.
- Assign an image to each button.
Use the Import button to select the image for each button.
Look in the Windows or WinNT directory for images. For this assignment you
may select any appropriate image stored on the computer or download these.
Icon Files: Right-click on image and select Save Image As or Save Picture As.
Tablet:
Pen:
- Double-click on the buttons to create the click methods.
MainForm In Design Mode:
- On Child1Form add a textbox (txtDate) and a DateTimePicker (dateTimePicker1).
Double-click on dateTimePicker1 to create the ValueChanged method,
and then add code to display the selected date
in txtDate when the value is changed. For DateTimePicker the date is
stored in the Value property.
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
txtDate.Text = DateTimePicker.Value.ToString();
}
- On Child2Form add a textbox (txtDate) and a MonthCalendar (monthCalendar1).
Double-click on monthCalendar1 to create the DateChanged method, and then add code to display the selected date
range in txtDate when the date is changed.
For MonthCalendar the date range is stored in the SelectionRange property as Start and End.
private void monthCalendar2_DateChanged(object sender, DateRangeEventArgs e)
{
txtDate.Text = monthCalendar1.SelectionRange.Start +
" - " + monthCalendar1.SelectionRange.End;
}
Submit the following files:
MainForm.cs, MainForm.Designer.cs, Child1Form.cs, Child1Form.Designer.cs, Child2Form.cs, and Child2Form.Designer.cs
Revised: 08/15/2006 - www.mc.maricopa.edu/~marquez/cis162ad/cs14_additional_controls.html