Created
December 22, 2017 12:42
-
-
Save davlgd/f4152617f67aa3a343b49b75fce474a2 to your computer and use it in GitHub Desktop.
AlticeStockChecker - Etape 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void UpdateLabelWithColor(float stock) | |
{ | |
if (stock > lastStock && lastStock != 0.0) | |
{ | |
lblStock.ForeColor = Color.Green; | |
} | |
else if (stock < lastStock && lastStock != 0.0) | |
{ | |
lblStock.ForeColor = Color.Red; | |
} | |
else | |
{ | |
lblStock.ForeColor = Color.Black; | |
} | |
lastStock = stock; | |
string finalStock = string.Format("{0} euros", stock.ToString()); | |
lblStock.Text = finalStock; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment