Mensaje
 
 
a
Todos
General information
Foro:
Visual FoxPro
Category:
Programación, sintáxis y comandos
Título:
Listboxes, Moverbars and Checkboxes
Miscellaneous
ID de la conversación:
00812520
ID del mensaje:
00812520
Views:
57
I have created a listbox with checkboxes, using bmps, and also enabled the moverbars on the control. The problem I am having is when the item is checked and then that same item is moved in the list. Once the item is moved, when the user selects another item to be checked, it checks the item that was in the same position before the move. Example, I have 5 items in the list 1-5. I check item 4 and move it to position number 1 in the list, 4,1,2,3,5. When I check number 2 in the list, it checks number 1 in the list not the line I have currently highlighted. This is the code I have in the Double Click event:

LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF LASTKEY()!= 5 AND LASTKEY() != 24
IF ThisForm.selectitemsel(This.ListItemID)=0
This.Picture(This.ListItemID)="checkbx.bmp"
ThisForm.selectitemsel(This.ListItemID)=1
ELSE
IF ThisForm.selectitemsel(This.ListItemID)=1
This.Picture(This.ListItemID)="box.bmp"
ThisForm.selectitemsel(This.ListItemID)=0
ENDIF
ENDIF
ENDIF

The list is setup with a Rowsourcetype = 0
Rowsource = tempselectlist (updatable cursor)
Moverbars = .t.
Columncount = 1

How do I keep what is selected, and when it is moved make sure that the next thing is selected is marked properly?
Next
Responder
Mapa
Ver