+ Reply to Thread
Results 1 to 3 of 3

Click event on listbox

  1. #1
    IanC
    Guest

    Click event on listbox

    I have a dialog that controls an interactive chart. This has a number of
    listboxes, all of which have click events attached. When the user selects an
    option in a box (say ListIndex = 4) that produces a combination of choices
    that is not allowed, I need to revert the listbox to a permissible option
    (say ListIndex =0).

    Unfortunately, this just seems to create a new click event that, for some
    reason, reverts the ListIndex back to the unpermissible option (i.e. 4) and
    repeats the error.

    Is there any way to stop these recurrent click events. I have tried using a
    static boolean expression and disabling events, but it does not seem to to
    stop the macro 'circling' at least twice.

    Ian

  2. #2
    Jim Thomlinson
    Guest

    RE: Click event on listbox

    Application.enableevents = false

    to turn events off. Be usre to turn them back on with

    Application.enableevents = true

    As these are application level evnet sit is a good idea to have an error
    handler which resets the events in the event of a problem. Also when you are
    debugging be carefule about stopping execution half way through. Your events
    will be off and the code will seem to be not reacting as it should...

    HTH

    "IanC" wrote:

    > I have a dialog that controls an interactive chart. This has a number of
    > listboxes, all of which have click events attached. When the user selects an
    > option in a box (say ListIndex = 4) that produces a combination of choices
    > that is not allowed, I need to revert the listbox to a permissible option
    > (say ListIndex =0).
    >
    > Unfortunately, this just seems to create a new click event that, for some
    > reason, reverts the ListIndex back to the unpermissible option (i.e. 4) and
    > repeats the error.
    >
    > Is there any way to stop these recurrent click events. I have tried using a
    > static boolean expression and disabling events, but it does not seem to to
    > stop the macro 'circling' at least twice.
    >
    > Ian


  3. #3
    IanC
    Guest

    RE: Click event on listbox

    Many thanks.

    The click event still repeats itself, but only after it has reached End Sub
    for the first time. And its ListIndex still reverts at that stage to the
    original (unpermissible) value. Taking out the change to ListIndex solves
    the problem (so I am reasonably certain that is the problem), but still
    leaves the original value showing in the ListBox.

    "Jim Thomlinson" wrote:

    > Application.enableevents = false
    >
    > to turn events off. Be usre to turn them back on with
    >
    > Application.enableevents = true
    >
    > As these are application level evnet sit is a good idea to have an error
    > handler which resets the events in the event of a problem. Also when you are
    > debugging be carefule about stopping execution half way through. Your events
    > will be off and the code will seem to be not reacting as it should...
    >
    > HTH
    >
    > "IanC" wrote:
    >
    > > I have a dialog that controls an interactive chart. This has a number of
    > > listboxes, all of which have click events attached. When the user selects an
    > > option in a box (say ListIndex = 4) that produces a combination of choices
    > > that is not allowed, I need to revert the listbox to a permissible option
    > > (say ListIndex =0).
    > >
    > > Unfortunately, this just seems to create a new click event that, for some
    > > reason, reverts the ListIndex back to the unpermissible option (i.e. 4) and
    > > repeats the error.
    > >
    > > Is there any way to stop these recurrent click events. I have tried using a
    > > static boolean expression and disabling events, but it does not seem to to
    > > stop the macro 'circling' at least twice.
    > >
    > > Ian


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1