
3. (SimpleEdit) Copy the SimpleEdit program you built for Exercise 2 and attach the tool strip
buttons to the corresponding event handlers.
4. (SimpleEdit) Copy the SimpleEdit program you built for Exercise 3 and add code to display
the appropriate image in the Background, Text Color, Offset, and Indent tool strip buttons.
For example, when the user selects Offset Subscript, the
offsetButton button should show
the subscript image.
To make using the foreground and background colors easier, save them in the
foreColorButton and backColorButton buttons’ ForeColor and BackColor properties.
For example, the following code shows what the program does when the user selects the
red foreground color. It displays the red image in the corresponding menu item, context
menu item, and tool strip button. It then saves the color in the
btnFg button’s ForeColor
property and finishes by displaying a placeholder message.
private void foreColorRedToolstripMenuItem_Click(
object sender, EventArgs e)
{
formatTextColorMenuItem.Image = foreColorRedToolstripMenuItem.Image;
textColorContextMenuItem.Image = foreColorRedToolstripMenuItem.Image;
foreColorButton.Image = foreColorRedToolstripMenuItem.Image;
foreColorButton.ForeColor = Color.Red;
MessageBox.Show(“Foreground Red”);
}
5. (SimpleEdit) Copy the SimpleEdit program you built for Exercise 4 and add appropriate
tooltips to the program’s ...