PDA

View Full Version : وسط چین کردن و Bold کردن فونت فقط اولین سطر RichtextBox



nurani
چهارشنبه 22 اردیبهشت 1395, 21:51 عصر
یعنی فقط اولین سطر وسط چین بشه و فونتش به حالت Bold در بیاد
البته متن این سطر قرمز است

Mahmoud.Afrad
چهارشنبه 22 اردیبهشت 1395, 22:17 عصر
if (richTextBox1.Lines.Length >= 1)
{
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = richTextBox1.Lines[0].Length;
richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
richTextBox1.SelectionFont = new Font(richTextBox1.Font.FontFamily, richTextBox1.Font.Size, FontStyle.Bold);
richTextBox1.SelectionColor = Color.Red;
}