font property of richtextbox
How to change the font property of richtextbox. Can anyone help me. Thanks in advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted Sep 3, 2009, 1:25 AM
FontStyle newFontStyle = (FontStyle)(currentFont.Style | FontStyle.Bold);
richTextBox1.SelectionFont = new Font(currentFont.FontFamily, 7, newFontStyle);
mohammed mahmoudPosted Sep 6, 2009, 9:40 AM
in the button_click event
private void button1_Click(object sender, EventArgs e)
{
if (fnt.ShowDialog() == DialogResult.OK)
{
richTextBox1.Font = fnt.Font;
}
}
and if u want to select text from richTextbox and change it , use this after select the text u want
private void button1_Click(object sender, EventArgs e)
{
if (fnt.ShowDialog() == DialogResult.OK)
{
richTextBox1.SelectionFont = fnt.Font;
}
}
Master BillaPosted Sep 2, 2009, 10:58 PM
private void btnchange_Click(object sender, EventArgs e)
{
richTextBox1.Font = new Font("verdana", 12, FontStyle.normal);
}
thank you
Kirtan PatelPosted Sep 2, 2009, 11:38 AM
dont forget to mark "Do you like answer" please it will give me some credits :)
private void button3_Click(object sender, EventArgs e)
{
//Setting Font Face m Font Size , Font Bold
richTextBox1.Font = new Font("Arial", 15, FontStyle.Bold);
}