I have a car class with four attributes (colour, model, mileage, year) and I get these attributes from four text boxes. I then assign these attributes to a new object of the car class and assign this new object to an object array in the car class. I need to be able to highlight the mileage attribute but I am outputting in a string builder like this it like this:
private void button1_Click(object sender, EventArgs e)
{
carColourIN = colour.Text;
carModelIN = model.Text;
carMileageIN = Double.Parse(mileage.Text);
carYearIN = Int32.Parse(year.Text);
Car user = new Car(carColourIN, carModelIN, carMileageIN, carYearIN);
Car.vehicles[i] = user;
StringBuilder sb = new StringBuilder();
sb.Append("Colour: " + Car.vehicles[i].CarColour + "\nModel: " + Car.vehicles[i].CarModel + "\nMileage: " + Car.vehicles[i].CarMileage
+ "\nYear: " + Car.vehicles[i].CarYear + "\n\n");
displayLabel.Text = sb.ToString();
i++;
}
how would I highlight the mileage attribute in the appended string builder so that either the background of that particular section of text is a different colour or the actual text is.