Solved

ToolStrip.CausesValidation not working as expected

Posted on 2007-11-16
1
1,332 Views
Last Modified: 2013-11-07
I am working on a Windows Forms application. I have a form that contains a ToolStrip. I have set the ToolStrip.CausesValidation = true, but a control with the focus does not raise a validated event when I click a button in the ToolStrip. What am I doing wrong here? Thanks.
0
Comment
Question by:Paracom_Inc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
topdog770 earned 500 total points
ID: 20320437
The problem is that the toolstripbutton object doesn't support the CausesValidation event.

I just made a quick test app to confirm this.  When the toolstrip button is clicked, calling the Form.Validate function may be your simplest option.

Otherwise, you could do something more complicated like keeping track of which textbox/control fired the TextChanged or similar event for example and only calling validate foreach one of the controls with changed text/ data.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

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