On Dec 12, 2006, at 2:20 PM, CV wrote:


On Dec 12, 2006, at 10:48 AM, Michael wrote:


HI All,
I have looked at the archives...but no help there, although I cannot believe this is not an uncommon issue. :-)

Is there a listbox, "not cellClick" event.?
For example. The user clicks a row of data....CellClick Sets ( a method) "InvokeEditMode".


Now The user clicks outside the listbox. I can unset with "lostfocus", but how can one get the same functionality if the user has clicked into an unused portion of the listbox.

Thank you all in advance....I am going to have to include all the names who have helped when this is done!!




You probably need to set a flag which distinguishes between a Cellclick and a click on the unused portion of the listbox, then read the flag in the Change event and add your functionality there.

When the unused portion is clicked, the Change event fires and ListIndex = -1. However, if an existing cell is clicked the Change event fires as well and ListIndex can equal -1 at that time also. So to distinquish between the two cases you can add a property of type boolean to the window: CellClicked, and set it to True in the CellClick event. Then in Change you can put something like this:

  If not CellClicked then
    If me.ListIndex = -1 then // clicked on unused portion
      // do whatever for "not CellClick"
    End
  Else // cell clicked
    CellClicked = False
    // do nothing here
  End

Hope I'm grasping what you are after...

Jack

Oh, I think I was fooling myself. The boolean isn't required, just the check for ListIndex = -1 in Change, as Roger has posted.

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to