Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5976875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:17:25+00:00 2026-05-22T21:17:25+00:00

If I create a simple Winforms app with a button and a textbox, and

  • 0

If I create a simple Winforms app with a button and a textbox, and the following event handlers, I’d expect to see “False” when I hit the button. When I hit the button, it actually produces “True”.

Why is the form valid? It doesn’t appear that the validating event is executing at all, even though the docs say that passing false causes validation to be performed unconditionally.

    private void button1_Click(object sender, EventArgs e)
    {
        MessageBox.Show(this.Validate(false).ToString());
    }

    private void textBox1_Validating(object sender, CancelEventArgs e)
    {
        e.Cancel = true;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:17:26+00:00Added an answer on May 22, 2026 at 9:17 pm

    It looks like you’re trying to validate a child control of the Form. If that’s the case, you should use one of the ValidateChildren methods instead of Validate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently discovered that I can use lambdas to create simple event handlers. I
I'm writing a simple winforms app in C#. I create a worker thread and
I would like to create simple objects at runtime (textbox, label, etc) and add
I have a ThreadStateException in my WinForms application. Step to reproduce: Create simple winforms
I'm making a WinForms app in C#. When I go to create my database
Is there a simple solution/idea/strategy to create a setTimeout equivalent function in a WinForms
I want to create a simple tabbed interface app. I did it before in
In a simple winform application, I call a function that endlessy create files on
I need to create simple reusable javascript object publishing several methods and parameterized constructor.
I know how to create simple object and add dynamically properties to it. object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.