Results 1 to 10 of 10

Thread: Text Box Leave event and Button click Event

Threaded View

  1. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Text Box Leave event and Button click Event

    Quote Originally Posted by scsfdev View Post
    Hi,

    It seemed solved but it still has problem.
    Although I moved my checking from Leave event to Validating event of a textbox, it still go and check when I click Button.

    I set my button's Cause Validating to False.
    I do the checking in TextBox Validating event.

    If I keyin some data in textBox and didn't go anywhere just directly click on Close button, it still go to Validating event which cause the message box to pop up if same ID is found in Database. And click event is not working too.

    Any way to prevent this happen????

    Thanks.
    You must be doing something wrong but it's not possible to say what from your description. I assure you, if your Button's CausesValidation property is set to False then clicking it will not raise a Validating event on the TextBox. I've attached a project that demonstrates. Try playing with it. The TextBox validates for a numeric value. Try entering different values and then leaving the TextBox in different ways to see the behaviour.
    Attached Files Attached Files
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width