I would like to make specific text bold, but I really don't know how. Can someone help me?
txt_logUser.Text = "Logged user is: " LogUser;
I would like to have bold text that will be in LogUser. What should i do? Thank for help :)
CodePudding user response:
You can't do this with normal textbox and you need to use RichTextBox C#
and you can use code something like this.
string boldText = "please bold me";
richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold);
richTextBox1.AppendText(boldText);
richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular);
richTextBox1.AppendText(" REGULAR TEXT APPEARS HERE");
Output : please bold me REGULAR TEXT APPEARS HERE
CodePudding user response:
A hacky
solution:
create another label/textBox
something txt_LogUserBold
make the Font bold. And place your textBoxes/labels near each other like:
txt_logUser txt_logUserBold
The result will be:
Logged user is: Something bold
The first is txt_logUser
's text, second is txt_logUserBold
's
CodePudding user response:
There is a question on here previously answered that I believe may be of assistance:
The concept seems pretty similar to what you're trying to do