Trying to create sorting code with 3 trackbar values using the if command in c#
<p>I have to create a windows form with(c#),</p>

<ul>
<li>3 trackbars</li>
<li>1 button</li>
<li>1 label</li>
</ul>

<p>Using the if and else if commands.
My problem is,
I cant get the end result to show up in label1.
I did manage to display them in labels2-4. But this is not the way to go for this assignment.</p>

<p>here's the code.</p>

<pre><code>    {
    public Form1()
    {
        InitializeComponent();
        trackBar1.Maximum = 10;
        trackBar1.Minimum = 0;
        trackBar2.Maximum = 10;
        trackBar2.Minimum = 0;
        trackBar3.Maximum = 10;
        trackBar3.Minimum = 0;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        int a;
        int b;
        int c;

        a = Convert.ToInt32 (trackBar1.Value);
        b = Convert.ToInt32 (trackBar2.Value);
        c = Convert.ToInt32 (trackBar3.Value);

        int d;
        int E;
        int f;

        if ((a &lt; b) &amp;&amp; (a &lt; c)&amp;&amp; (b&gt; c))
        {
            label2.Text = Convert.ToString(d = a);
            label3.Text = Convert.ToString(E = c);
            label4.Text = Convert.ToString(f = b);
            label1.Text =Convert.ToString (string d,e,f);
        }
        if ((a &lt; b) &amp;&amp; (a &lt; c) &amp;&amp; (b &lt; c))
        {
            label2.Text = Convert.ToString(d = a);
            label3.Text = Convert.ToString(E = b);
            label4.Text = Convert.ToString(f = c);
        }
        else if ((a &gt; c) &amp;&amp; (a &gt; b) &amp;&amp; (b &gt; c))
        {
            label2.Text = Convert.ToString(d = c);
            label3.Text = Convert.ToString(E = b);
            label4.Text = Convert.ToString(f = a);
        }
        else if ((a &lt; c) &amp;&amp; (a &gt; b) &amp;&amp; (b &gt; c))
        {
            label2.Text = Convert.ToString(d = c);
            label3.Text = Convert.ToString(E = a);
            label4.Text = Convert.ToString(f = b);
        }
        else if ((b &lt; a) &amp;&amp; (b &lt; c) &amp;&amp; (c &gt; a))
        {
            label2.Text = Convert.ToString(d = b);
            label3.Text = Convert.ToString(E = a);
            label4.Text = Convert.ToString(f = c);
        }
        else if ((b &lt; a) &amp;&amp; (b &lt; c) &amp;&amp; (c &lt; a))
        {
            label2.Text = Convert.ToString(d = b);
            label3.Text = Convert.ToString(E = c);
            label4.Text = Convert.ToString(f = a);
        }
    }
</code></pre>

<p>I need label1.Text to be the result of labels 2-4, I tried this label1.Text= Convert.ToString(d = b + E = c + f = a) and I tried replacing the + with , but that wont work either. I think I have to use a string format but I wouldn't know how and if its needed.</p>
