How behave in the Validating event?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How behave in the Validating event?

  1. #1
    Mike Guest

    How behave in the Validating event?



    How should I behave in a Validating event if the data is invalid?

    Public Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.EventArgs)
    Handles TextBox1.Validating

    If Not DataIsValid(TextBox1.Text) then
    ' <---- code??

    End If
    End Sub



  2. #2
    Mark Burns Guest

    Re: How behave in the Validating event?


    "Mike" <mike@nospam.somewhere.nu> wrote in message
    news:3a9b9847$1@news.devx.com...
    >
    >
    > How should I behave in a Validating event if the data is invalid?
    >
    > Public Sub TextBox1_Validating(ByVal sender As Object, ByVal e As

    System.EventArgs)
    > Handles TextBox1.Validating
    >
    > If Not DataIsValid(TextBox1.Text) then
    > ' <---- code??
    >
    > End If
    > End Sub


    Isn't the validate event a function (Boolean) and not just a sub?




  3. #3
    Sjoerd Verweij Guest

    Re: How behave in the Validating event?

    > How should I behave in a Validating event if the data is invalid?

    Have you tried playing with E.Handled?




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center