c# - Change a font style in a TextBox -
i have several text box's input added. these input displayed in text box @ bottom of program after button clicked.
i want make 1 of strings display italics in text box @ bottom of program.
here have.
private void button1_click(object sender, eventargs e) { string author; string name; string year; string title; string place; string publisher;
name = textbox2.text + ", "; author = textbox1.text + ". "; year = "(" + textbox3.text + ") "; title = textbox4.text + ", "; place = textbox5.text + ", "; publisher = textbox6.text + "."; // output reference field richtextbox1.text = name + author + year + title + place + publisher; }
what want display title string in italics.
any great. thanks
richtextbox1.find(title, richtextboxfinds.matchcase); richtextbox1.selectionfont = new font(richtextbox1.font, fontstyle.italic);
that should italicize title of book , title of book, while keeping font same rest of rich text box.
Comments
Post a Comment