Results 1 to 4 of 4

Thread: Cancel a Click event

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Cancel a Click event

    Hi,

    Let's say that a user clicks on a listbox's item, the click event is generated. What if after some validation, the program should move back to the previous index because something is missing etc.

    How can I cancel a click event?
    I tried to change the listindex to the old one, but that generates another click event.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    Junior Member
    Join Date
    Jul 2003
    Posts
    24
    I dont know what you mean. Is it just during a process that you want the user to be unable to click on the listbox? Please be more specific, in the mean time would this work -

    Code:
    List1.Enabled = False
    M4tt

  3. #3
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    I tried to change the listindex to the old one, but that generates another click event.
    set a boolean variable to false, then change the listindex then set the variable back to true. Test the variable on entry to the click even and if it's false, exit immediately

  4. #4
    Fanatic Member
    Join Date
    Jun 2003
    Location
    IL
    Posts
    739
    Yep the boolean idea is the best way to go. I do this all the time with data validation and such.
    Motto: Anything for a laugh.

    Getting second place only means you are the first loser to cross the finish line.

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