Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


ErrorProvider prevents form from closing

Posted on 2006-03-31
Medium Priority
Last Modified: 2008-02-01
Looking at MSDN sample SplitContainer I found that ErrorProvider control doesn't allow to close owner form if there is some error. For example, if I type non-numeric string to the Splitter Width editbox, form cannot be closed.
In typical dialog I would like to prevent it from closing using OK button, if there is error, and allow to close using Cancel or Close button in any case. How can I do this?
Question by:AlexFM

Accepted Solution

CoderForChrist earned 1500 total points
ID: 16345343
You can force the edit to complete, which undoes the user's last edit.

Get a reference to the BindingManager and then call EndEdit
LVL 48

Author Comment

ID: 16345668
Well, actually I found that this not ErrorProvider, this is because of e.Cancel = true in Validating event.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question