ErrorProvider prevents form from closing

Posted on 2006-03-31
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
    LVL 4

    Accepted Solution

    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

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

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    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 introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now