Basically, I want a label to display the result in a different colour. At the moment the program simply outputs a message along with a variable, what i want to do is have the variable in a different colour to the text. E.g. my variable is called InterestToBePaid of the type float, the current code is:
lblInterestToBePaid1Year.Text = "The Total Interest You Have To Pay For One Year Is: " + InterestToBePaid;
How would I change InterestToBePaid in to a different colour?
Umar AnjumPosted Feb 2, 2014, 6:12 PM
Umar AnjumPosted Feb 2, 2014, 5:53 PM
VulpesPosted Feb 2, 2014, 5:50 PM
A couple of points on this:
1. It's meaningless to talk about the 'Total amount for one year' here, so I've removed this code altogether:
2. We're doing this in a very simplistic way because we're charging the same interest every year even though capital is being repaid throughout the term. The total repayments are therefore higher than they should be. However, if you haven't been taught the formula for working out mortgage repayments properly, you can hardly be expected to figure it out yourself so this will have to do for now.
Umar AnjumPosted Feb 2, 2014, 4:45 PM
VulpesPosted Feb 2, 2014, 4:43 PM
Could you try again or just post the code.
Umar AnjumPosted Feb 2, 2014, 4:38 PM
Umar AnjumPosted Feb 2, 2014, 3:56 PM
VulpesPosted Feb 2, 2014, 3:54 PM
Umar AnjumPosted Feb 2, 2014, 3:44 PM
VulpesPosted Feb 2, 2014, 3:42 PM
He has even been involved in the standardization committees for C and C++.
Umar AnjumPosted Feb 2, 2014, 3:29 PM
VulpesPosted Feb 2, 2014, 3:23 PM
Set the Text property of the first label to: "The Total Interest You Have To Pay For One Year Is: " and the Text property of the second label to the expression: InterestToBePaid.ToString().
You can now set the colors of the two labels to whatever you want.