I have one textbox which has the following text.
TextBox1.Text = "The above materials will be delivered at Site. One copy of the Delivery Challan / Invoice to be send to Head Office."
In that, I want to make the following text "One copy of the Delivery Challan / Invoice to be send to Head Office" as in Capital Letters and also in Bold.
I tried the following coding:
TextBox1.Font.Bold = true;
But it made all the text as bold. How do I make it?
Since you are just distributing data and not allowing the user to edit the value I would suggest using a combo(or div span your choice) using Styles. It requires absolutely no server side code for example
You can then access either portion using javascript to getElementsById.
Alternatively if it isn't an HTML based object I would argue to use two labels instead of a textbox. One could be bold and the other normal.
Since you're using a web application, you can't use the RichTextBox component.
Instead, you can use a
LiteralControl
inside aspan
or adiv
.i.e:
Put two textbox instead of one. In windows forms it's the only way. in Wpf, the answer is here.