III.13- Using RichTextBox
C#, RichTextBox control is a textbox which gives you rich text editing controls and advanced formatting features also includes a loading rich text format (RTF) files. Or in other words, RichTextBox controls allows you to display or edit flow content, including paragraphs, images, tables, etc.
Properties:
Source Code:
private void
mnuLoadFile_Click(object sender, EventArgs e)
{
RTB.SaveFile("C:\\test.rtf", RichTextBoxStreamType.RichText);
}
private void
mnuSaveFile_Click(object sender, EventArgs e)
{
RTB.LoadFile("C:\\test.rtf");
}
private void
mnuBold_Click(object sender, EventArgs e)
{
RTB.SelectionFont = new Font("Time
New Roman", 12, FontStyle.Bold);
}
private void
mnultalic_Click(object sender, EventArgs e)
{
RTB.SelectionFont = new Font("Time
New Roman", 12, FontStyle.Italic);
}
private void
mnuUnderLine_Click(object sender, EventArgs e)
{
RTB.SelectionFont = new Font("Time
New Roman", 12, FontStyle.Underline);
}
private void
mnuLimonR1_Click(object sender, EventArgs e)
{
RTB.SelectionFont = new Font("Limon
R1", 22, FontStyle.Regular);
}
private void
mnuRed_Click(object sender, EventArgs e)
{
RTB.SelectionColor = Color.Red;
}
private void
mnuBlue_Click(object sender, EventArgs e)
{
RTB.SelectionColor = Color.Blue;
}
0 Comments