vendredi 19 octobre 2018

Call a CheckBox's Text to a MessageBox?

Hello I'm having trouble trying to get this part of my code working:

 private void selectedBox(string text)
    {
        var boxes = new Control[] { f1.checkEdit7, f1.checkEdit8, f1.checkEdit9 };
        foreach (var box in boxes)
        {
            if(box.Checked == true)
            {
                text = box.Text.ToString();
            }
        }
    }

I want to be able to get the selected checkbox's text and call it in a MessageBox, how would I achieve this? Thank you!




Aucun commentaire:

Enregistrer un commentaire