Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: ListBox InteractiveChange
Thread ID: 209399 Message ID: 209434 # Views: 2 # Ratings: 1
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Sunday, December 28, 2008 7:49:26 PM         
   


> Hi all,
>
> I have a ListBox with MoverBars = .T.
>
> Using help I recently received from Anders, I am looping through the ListBox items in the InteractiveChange event:
>
>
lbobj = This
> many_items = lbobj.ListCount
> items_string = ''
> FOR loop=1 TO many_items
>     items_string = items_string + '~' + lbobj.List(loop,1)
> NEXT
> MESSAGEBOX(items_string)

> Now when I move an item in the ListBox to somewhere else I see the correct MESSAGEBOX detail but I see it twice.
>
> Based on items_string, I want to do some SQL UPDATE stuff to a table to be used for a Grid definition but I'd rather do it just once.
>
> Does anyone know why the InteractiveChange event is firing twice in this situation?
>
> If so, what is the remedy?
>
> Thanks,
>
> Russell.

to solve this problem use this .
create a new property form1.mystore (initialize to 0)

In list1.interactiveChange
if thisform.list1.listindex=thisform.mystore
else
lbobj = Thisform.list1
many_items = lbobj.ListCount
items_string = ''
FOR loop=1 TO many_items
    items_string = items_string + '~' + lbobj.List(loop,1)
NEXT

messagebox(items_string )
thisform.mystore=thisform.list1.listindex
endi


then you see one once your messagebox (with mouse and important with keyboard also).listindex is the solution.
In list1.interactive event ,this fires with two events in one time .the first clic to move and the final mouseup.

regards

ENTIRE THREAD

ListBox InteractiveChange Posted by Russell Hill @ 12/28/2008 11:24:38 AM
RE: ListBox InteractiveChange Posted by Stefan Wuebbe @ 12/28/2008 2:36:41 PM
RE: ListBox InteractiveChange Posted by Russell Hill @ 12/29/2008 12:44:11 PM
RE: ListBox InteractiveChange Posted by tushar @ 12/28/2008 3:38:30 PM
RE: ListBox InteractiveChange Posted by Russell Hill @ 12/29/2008 12:43:35 PM
RE: ListBox InteractiveChange Posted by Yousfi Benameur @ 12/28/2008 7:49:26 PM
RE: ListBox InteractiveChange Posted by Russell Hill @ 12/29/2008 12:42:57 PM