Sasa February 2016

C# WPF - Setting Textbox.Text to string doesn't work

I have got 3 Textboxes.

  • WHRScore
  • KFScore
  • FettGesamtscore

I want to compare WHRScore and KFScore to eachother, in order to set a new string into FettGesamtscore as Text. My little Code:

if (WHRScore.Equals("+") && KFScore.Equals("-"))
            {
                FettGesamtscore.Text = "Ø";

            }

I already have set 2 breakpoints. The first breakpoint fires in the if-clause and works pretty good, but the second breakpoint doesn't fire at FettGesamtscore.Text = "Ø". I dont know why this line is not being executed, maybe you can help me ?

I have already used the same princip with other code, where it works like a charm. For example in the same window:

  if (WHR >= 0.80 && WHR <= 0.84)
                        {

                            WHRScore.Text = "+";
                        }

The same for the other textbox..

if (fp >= 19.0 && fp <= 20.9)
                            {

                                KFScore.Text = "-";;
                            }

As you can see on the picture below, it is working there like a charm.

Any help is highly appreciated!

Thank you in advance!

Answers


Douglas DeTellem February 2016

would have added as a comment, but not enough rep.

shouldn't you use:

if (WHRScore.TEXT.Equals("+") && KFScore.TEXT.Equals("-"))
        {
            FettGesamtscore.Text = "Ø";

        }

Post Status

Asked in February 2016
Viewed 1,156 times
Voted 8
Answered 1 times

Search




Leave an answer