I want to know if or how I can use the flag enum and return the enum parameter in another class
<p>I have a list of flag enums for input validation, I want to return one of the enums as part of my validation. So far this is what I come up with...<br>
These are my enums.  </p>

<pre><code>[Flags]
public enum CheckInput
{ 
    Not_Valid, 
    OK, 
    No_First_Name, 
    No_Last_Name, 
    No_Password, 
    Wrong_Password 
};
</code></pre>

<p>This is my switch to show a message for when an enum is used  </p>

<pre><code>public void ValidInputSwitch()
{
    CheckInput Status = CheckInput.Not_Valid;
    do
    {
        switch (Status)
        {
            case CheckInput.No_First_Name:
                MessageBox.Show("Please enter your first name.");
                break;
            case CheckInput.No_Last_Name:
                MessageBox.Show("Please enter your last name.");
                break;
            case CheckInput.No_Password:
                MessageBox.Show("Please enter your password.");
                break;
            case CheckInput.Wrong_Password:
                MessageBox.Show("Your passwords do not match!");
                break;
            case CheckInput.OK:
                CheckUserName(Uname);
                break;
            default:
                break;
        }
    }
    while (Status != CheckInput.OK);
}
</code></pre>

<p>Here is where my problem lies, I want to validate input and RETURN the enum so that it can run with my switch and show the message that is there  </p>

<pre><code>public CheckInput InputCheck
{
    {
        if (firstNameTxt.Text == null || firstNameTxt.Text == "") { return CheckInput.No_First_Name; }
    }
}
</code></pre>

<p>I actually abandoned this idea in the end and used "Error Reporting". I couldn't quite get this method to work for me. Definitely due to my lack of know how. One day I'll hope to have solved the problem I had.</p>