bypassing validation with a button click

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bernie Yaeger

    #1

    bypassing validation with a button click

    I validate - through a delegate - several textbox data when an 'add' button
    is clicked. However, when the 'close' button is clicked, I don't want to
    validate - I just want to window to close. I know how to override the
    validation when the window's 'x' button is clicked with the following:

    Protected Overrides Sub WndProc(ByRef m As System.Windows. Forms.Message)

    If m.Msg = &H10 Then

    needvalidating = False

    End If

    MyBase.WndProc( m)

    End Sub

    But I can't figure out what to do with a 'close' button on the screen - the
    validation begins before any code inside the close.click, so how can I do
    this?

    Thanks for any help.

    Bernie Yaeger




  • Cor Ligthert [MVP]

    #2
    Re: bypassing validation with a button click

    Bernie,

    In my idea did we not see you a while. I am glad to see you back.

    I don't see why you use a delegate (reference) for this simple problem and
    don't call the validating procedure direct by its method, it can not be
    threading, because for that you spent almost for sure more time by starting
    that threading, than your validating can take time.

    However, that is not so important, what I don't see is how that procedure
    can be started by pushing at the close x button. You told that it started by
    an 'add' button. So it should not be done by a close.
    [color=blue]
    >I validate - through a delegate - several textbox data when an 'add'
    >button is clicked. However, when the 'close' button is clicked, I don't
    >want to validate - I just want to window to close. I know how to override
    >the validation when the window's 'x' button is clicked with the following:
    >[/color]
    Can you give us some information about that?

    Cor


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: bypassing validation with a button click

      "Bernie Yaeger" <berniey@optonl ine.net> schrieb:[color=blue]
      >I validate - through a delegate - several textbox data when an 'add'
      >button is clicked. However, when the 'close' button is clicked, I don't
      >want to validate - I just want to window to close. I know how to override
      >the validation when the window's 'x' button is clicked with the following:[/color]

      See:

      <URL:http://groups.google.d e/group/microsoft.publi c.dotnet.framew ork.windowsform s/msg/e29f17fc4b6b7d6 8>

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...