I want to change text color of Not working Links if link is not working its color should be red. and my links are in textbox
if (!IsLinkWorking(link))
{
//Here you can show the error. You don't specify how you want to show
TextBox2.Text += string.Format(
"{0}\nNot working\n\n ", link);
// this should be in red which is in textbox2.text
}
else
{
TextBox2.Text += string.Format("{0}\n working\n\n", link);
}
You can change the text color of the TextBox with the ForeColor property, but you can not display portions of text in a different color. You will need a RichTextBox, or something similar, for that.
To change the text color of a TextBox control:
TextBox2.ForeColor = System.Drawing.Color.Red;
TextBox2.Text += string.Format("{0}\nNot working\n\n ", link);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With