際際滷

際際滷Share a Scribd company logo
Vp lecture 11 ararat
Vp lecture 11 ararat
Vp lecture 11 ararat
Select the ContextMenuStrip control and start adding the name of menus, for example I added menus like Background,
foreground and then add form, button submenu to Background menu .
After adding the name of the menu on you application, right-click on the Windows Forms application and go to the
properties.
Select "ContextMenuStrip" and change it to ContextMenuStrip1 from (none).
To add code to menus double click in the menu and add the code
run the project and right-click on the form, the Context Menu will appear on the form as shown in the
following image.
 RichTextBox has many formatting options.
It applies colors, background colors,
multiple fonts, and margins to the text.
 It adds more complexity than the regular TextBox.
 But the RichTextBox provides needed features to
programs.
example
private void button1_Click(object sender, EventArgs e)
{
richTextBox1.SelectionBackColor = Color.Coral;
richTextBox1.AppendText(this.textBox1.Text);
}
private void button1_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
richTextBox1.SelectionColor = colorDialog1.Color;
richTextBox1.AppendText(" hi");
}
OR
Vp lecture 11 ararat

More Related Content

Vp lecture 11 ararat

  • 4. Select the ContextMenuStrip control and start adding the name of menus, for example I added menus like Background, foreground and then add form, button submenu to Background menu .
  • 5. After adding the name of the menu on you application, right-click on the Windows Forms application and go to the properties. Select "ContextMenuStrip" and change it to ContextMenuStrip1 from (none). To add code to menus double click in the menu and add the code
  • 6. run the project and right-click on the form, the Context Menu will appear on the form as shown in the following image.
  • 7. RichTextBox has many formatting options. It applies colors, background colors, multiple fonts, and margins to the text. It adds more complexity than the regular TextBox. But the RichTextBox provides needed features to programs.
  • 8. example private void button1_Click(object sender, EventArgs e) { richTextBox1.SelectionBackColor = Color.Coral; richTextBox1.AppendText(this.textBox1.Text); } private void button1_Click(object sender, EventArgs e) { colorDialog1.ShowDialog(); richTextBox1.SelectionColor = colorDialog1.Color; richTextBox1.AppendText(" hi"); } OR