Solved

ToolStrip.CausesValidation not working as expected

Posted on 2007-11-16
1
1,286 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

19 Experts available now in Live!

Get 1:1 Help Now