Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ToolStrip.CausesValidation not working as expected

Posted on 2007-11-16
1
Medium Priority
?
1,376 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 2000 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 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