lundi 23 octobre 2017

How to get variable as a result of a comparison?

I have a windows form and a simple horce racing application. My horses are pictureBox controls. I want to print the winner by checking who is more far away from starting point.

    control aa.left = (unknown integer value);
    control bb.left = (unknown integer value);
    control cc.left = (unknown integer value);

  • If first one has the biggest value, I want to print "First one is champion"
  • If second one has the biggest value, I want to print"Second one is champion"
  • If third one has the biggest value, I want to print "Third one is champion"

Is there an easy way to do this other then creating an if structure - "check aa with bb, aa with cc, bb with cc"

In other words, how to get the variable with biggest left property.

Aucun commentaire:

Enregistrer un commentaire