Click here to Skip to main content
15,886,721 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi iam showing a
windows form in a popup (DialogResult dlgResult = dlgabc.ShowDialog(this)

dlgabc form is having ok button .iam validating some code in the ok check and giving message regarding the validation .when user click on ok the validation message is firing and the pop up form is getting closed and not allowing the user to correct the text in the popup form .how to restict the closing of the form when validation fails in the ok click and allow the user to enter the validate text in the text box of the popup form.

regards
Posted

1 solution

Set DialogResult[^] property for OK button to None, validate and when validation is OK, set DialogResult property to OK.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900