I have a multiline textbox control where I would like to load up with
something like the following:
This is Line 1 <- this line is NOT bold
This is Line 2 <- this line is bold
This is Line 3 <- this line is NOT bold
I have attempted to use C# code like the following:
string part1 = "This is Line 1" + Environment.New Line;
string part2 = "This is Line 2" + Environment.New Line;
string part3 = "This is Line 3" + Environment.New Line;
textbox.Text = part1;
textbox.Font = new Font(textbox.Fo nt, textbox.Font.St yle |
FontStyle.Bold) ;
textbox.AppendT ext(part2);
textbox.Font = new Font(textbox.Fo nt, textbox.Font.St yle | !
FontStyle.Bold) ;
textbox.AppendT ext(part3);
But the compiler complains that the ! operator cannot appear where it
is. I know there has to be some simple way to do this, but I just
haven't been able to find it yet.
Can anyone help?
TIA,
something like the following:
This is Line 1 <- this line is NOT bold
This is Line 2 <- this line is bold
This is Line 3 <- this line is NOT bold
I have attempted to use C# code like the following:
string part1 = "This is Line 1" + Environment.New Line;
string part2 = "This is Line 2" + Environment.New Line;
string part3 = "This is Line 3" + Environment.New Line;
textbox.Text = part1;
textbox.Font = new Font(textbox.Fo nt, textbox.Font.St yle |
FontStyle.Bold) ;
textbox.AppendT ext(part2);
textbox.Font = new Font(textbox.Fo nt, textbox.Font.St yle | !
FontStyle.Bold) ;
textbox.AppendT ext(part3);
But the compiler complains that the ! operator cannot appear where it
is. I know there has to be some simple way to do this, but I just
haven't been able to find it yet.
Can anyone help?
TIA,
Comment