Results 1 to 5 of 5

Thread: Check wheter a button or textbox is clicked.

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2012
    Location
    Los Angeles, CA
    Posts
    47

    Check wheter a button or textbox is clicked.

    I have two text boxes (txt1, txt2) and an exit button (btnExit)
    In txt1.Leave event; i have some validations. If validation fails then I keep the fous on txt1.
    If btnExit is clicked then I do not want to execute the validation and instead close the application.. How do I do it?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Check wheter a button or textbox is clicked.

    Do not enable the button until the validation has been completed.

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2012
    Location
    Los Angeles, CA
    Posts
    47

    Re: Check wheter a button or textbox is clicked.

    The button btnExit needs to be enabled since it's an EXIT button and can be clicked regardless of what was entered in txt1.text.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Check wheter a button or textbox is clicked.

    Sorry....I misunderstood you....

    If your validations are in the Leave event they will fire immediately after you leave the textbox. It does not matter what you do next. The validations will fire.

    What do the validations consist of?

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2012
    Location
    Los Angeles, CA
    Posts
    47

    Re: Check wheter a button or textbox is clicked.

    txt1.text accepts numeric value (zip code); I validate the zip code.

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