juliogyn wrote:
But the dialog close and does not work.
Of course it does, because the tests you are making only happen after the ShowDialog() method returns. Check http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx[^] for full details of how this operates. You need to trap the events that cause the dialog to be closed, and add your tests there to prevent it closing until the correct data is entered by the user.
Veni, vidi, abiit domum