Last active
August 29, 2015 14:11
-
-
Save joebuschmann/caede8ad756c68832512 to your computer and use it in GitHub Desktop.
The correct way to validate and close a modal form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void btnOK_Click(object sender, EventArgs e) | |
| { | |
| if (Validate()) | |
| { | |
| _selectedUsers.Clear(); | |
| foreach (var user in _allUsers.Where(u => u.Selected)) | |
| _selectedUsers.Add(user.UserId, user.UserName); | |
| } | |
| else | |
| DialogResult = DialogResult.None; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment