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
Solved

ToolStrip.CausesValidation not working as expected

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

792 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