74
LESSON 6 Making Tool STripS and STaTuS STripS
2. Set the Background ColorWhite menu item’s Checked property to True.
Give the Background Color menu items
Images that display samples of the color.
1. Set the Image properties of these menu items to samples of their colors. (Use Microsoft
Paint or some other graphical editor to make small colored images.)
Create the
ToolStrip with buttons that duplicate the menu hierarchy. The ToolStrip
should hold two
ToolStripDropDownButtons.
Name the first tool
ToolStripDropDownButton textColorButton and make it display the
text “A.” Give it the items Black, Red, Green, and Blue. Each item should have
ForeColor
property set to its color.
1. Create the ToolStripDropDownButton.
2. Below that item, add the items Black, Red, Green, and Blue.
3. Set the ForeColor property for each of these items to show its color (that is, set the
Black item’s
ForeColor property to black).
Name the second tool
ToolStripDropDownButton backColorButton and make it initially
display a white color sample. Give it the items White, Pink, Green, and Blue. Make each of
these display an
Image showing a sample of the color.
1. Create the ToolStripDropDownButton.
2. Below that item, add the items White, Pink, Green, and Blue.
3. Set the Image property for each of these items to show samples of their colors.
Give the
StatusStrip a ToolStripStatusLabel named colorLabel with Text =
Text Colors.
1. Create the ToolStripStatusLabel. Set its Name and Text properties.
Add event handlers.
Make the File menu’s Exit item close the form.
1. Type the bold line of code so the event handler looks like this:
private void leExitMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
Make event handlers for each of the Text Color menu items.
1. For the Text ColorBlack menu item, type the bold code so the event handler looks
like this:
private void textColorBlackMenuItem_Click(object sender, EventArgs e)
{
contentsRichTextBox.ForeColor = Color.Black;
textColorMenuItem.ForeColor = Color.Black;
textColorButton.ForeColor = Color.Black;
colorLabel.ForeColor = Color.Black;
596906c06.indd 74 4/7/10 12:32:01 PM