How can i make a return statement out of this?

if (cmbGrootte.SelectedIndex == 0)
                lstboxBestellingen.Items.Add(txtKopjes.Text + " " + cmbGrootte.SelectedItem + " " + Convert.ToString(lstboxKoffieSoort.SelectedItem) +  " besteld voor " + (2 * int.Parse(txtKopjes.Text) + double.Parse(txtFooi.Text)));
            else
            {
                if (cmbGrootte.SelectedIndex == 1)
                    lstboxBestellingen.Items.Add(txtKopjes.Text + " " + cmbGrootte.SelectedItem + " " + Convert.ToString(lstboxKoffieSoort.SelectedItem) + " besteld voor " + (3 * int.Parse(txtKopjes.Text) + double.Parse(txtFooi.Text)));
                else
                {
                    if (cmbGrootte.SelectedIndex == 2)
                        lstboxBestellingen.Items.Add(txtKopjes.Text + " " + cmbGrootte.SelectedItem + " " + Convert.ToString(lstboxKoffieSoort.SelectedItem) + " besteld voor " + (4 * int.Parse(txtKopjes.Text) + double.Parse(txtFooi.Text)));
                    else
                        lstboxBestellingen.Items.Add(txtKopjes.Text + " " + cmbGrootte.SelectedItem + " " + Convert.ToString(lstboxKoffieSoort.SelectedItem) + " besteld voor " + (3 * int.Parse(txtKopjes.Text) + double.Parse(txtFooi.Text)));

Welcome to the forum, @Jelledesoete

I’m not sure that I understand the question fully. You’re looking to make a return statement from this? I would try to use a switch statement possible and then return the value from within the switch statement.

Hey, how would one do this? I’ll try myself and post a screenshot later, but i’m sure it won’t be functional xp

Heyy,

I’d like to know what you mean by make it more functional? Do you mean make the code shorter? You can have a look at short circuit evaluations in JavaScript, it might help you solve this better if that’s the case.