I have this code for found Textbox1 greatest Textbox2 The code working but if I make “0” or “0,5” there are an bug (if there are ",").
Anybody to have an solution for accept "0" or "," ?
public partial class MainWindow : Window
{
int point1, point2;
int point3, point4;
public MainWindow()
{
InitializeComponent();
point1 = point2 = 0;
point3 = point4 = 0;
}
private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
if (textBox1.Text != "") {
point1 = int.Parse(textBox1.Text);
int tt;
int uu;
tt = point1 - point2;
uu = point3 - point4;
if (tt >=uu)
texboxxol1.Background = Brushes.Yellow;
texboxxol2.Background = Brushes.White;
}
}
private void textBox2_TextChanged(object sender, TextChangedEventArgs e)
{
if (textBox2.Text != "")
{
point2 = int.Parse(textBox2.Text);
int tt;
int uu;
tt = point1 - point2;
uu = point2 - point1;
if (uu >= tt)
texboxxol2.Background = Brushes.White;
texboxxol1.Background = Brushes.Yellow;
}
}