Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabled selected item in listbox

Status
Not open for further replies.

sdmi

Programmer
Dec 6, 2001
17
US
In my program client client select item from list box. I use command button to move this item in textbox for further use. I tried to disable this porticular item, therefore client will not be able to select again. Code under command Move.click() look like this:
if thisform.lstInputfields.listcount != 0
for icount = 1 to gnFieldcount
if thisform.lstInputfields.selected(icount)
thisform.txtFullname.value =
thisform.lstInputfields.list (icount)
thisform.cmdBackfullname.enabled = .T.
thisform.cmdMovefullname.enabled = .F.
??????????????????????????????????????????????????
?? thisform.lstInputfields.enabled(icount)= .F. ??
??????????????????????????????????????????????????
endif
enfor
endif
 
When I have a list and a user selects an item, I get rid of it:
Code:
WITH THIS.PARENT
   STORE 1 TO indx

   &&... Use do while not for because list decreases 
   &&...   each time you remove an item
   DO WHILE indx <= .lbCustList.LISTCOUNT
      &&... if item selected, first add it to 
      &&...  another list or whatever, then remove
      IF .lbCustList.SELECTED(indx)   
         .lbCopyList.ADDLISTITEM(.lbCustList.listitem(.lbCustList.IndexToItemID(indx)))
         .lbCustList.REMOVELISTITEM(.lbcustlist.IndexToItemID(Indx))
      ELSE
         indx = indx + 1
      ENDIF
   ENDDO
ENDWITH
Dave S.
[cheers]
 

hi sdmi,

or you can have the list rowsourcetype set to array, and disable your list by adding &quot;\&quot;.

=)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top