Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling items in list box
Message
From
19/11/1998 14:40:56
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00159415
Message ID:
00159445
Views:
26
>>>>>I have a list box with a small amount of items in it. (Usually < 5). If one of the items is already in use, I want to disable it. I vaguely remember seeing once that you can put a \ in front of the item to disable it, but how do you put it there? I don't know how to edit an item on the list.
>>>>>
>>>>>I suppose I could make the cursor it's based on writable and change it there and requery the listbox, but it seems like it should be simpler than that.
>>>>>
>>>>>Anyone know?
>>>>>
>>>>>Thanks,
>>>>>
>>>>>-Michelle
>>>>
>>>>You cannot disable items in listbox based on cursor, but you can make it for array or none (additem()). This case, you may issue:
>>>>thisform.mylist.list(3)="\"+thisform.mylist.list(3)
>>>>to disable e.g. third item.
>>>>Unfortunately, it's not over yet. Item will really look disabled, but still accessible by down/up arrows, it may force to code Listbox.InteractiveChange event to exclude such selection.
>>>
>>>That should be ok for this purpose. I only need it to look disabled. I can just put code there that it won't take the action if it's disabled.
>>>
>>>When the user clicks on an item, how do I know which number in the list it is?
>>>
>>>Thanks,
>>>
>>>-Michelle
>>
>>thisform.mylist.listitemid
>
>Ok, now I have a similar question. I made an array of opname and opkey and made that the rowsource. Opname is what is displayed. When a user clicks on one, how do I know what the opkey is? With a cursor, it would just be ops.opkey. But with an array, I don't know which element is being clicked on.
>
>Thanks,
>
>-Michelle

even simpler:
? myarray[thisform.mylist.listitemid,2]
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform