Hello,
I'm calculate the persentage between two numbers.
After the calculation I want that the positive numbers are green and the others red.
It's working good, but the numbers -0.25 are still green instead of red.
How can I change that?
Here's my code for calculation and coloring the text:
Thanks in advance,Code:Dim C1 As String = TextBox11.Text Dim D1 As String = TextBox1.Text Dim percentage As Decimal = Val(D1 - C1) / C1 * 100 TextBox16.Text = String.Format("{0:0.00}", percentage) & " " & "%" If Val(TextBox16.Text) >= 0.00 Then TextBox16.Font = New Font("Adobe Devanagari", 11.0, FontStyle.Bold) TextBox16.ForeColor = Color.DarkGreen Else TextBox16.Font = New Font("Adobe Devanagari", 11.0, FontStyle.Bold) TextBox16.ForeColor = Color.Red End If





Reply With Quote