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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I disable elements from a listbox?????

Status
Not open for further replies.

rocketlauncher

Programmer
Nov 11, 2000
110
0
0
US
Hi! Hope someone can help me with this one.

I designed a form that has two listboxes. One listbox has the elements that user can select and the other listbox displays the elements that the user has selected. My situation is that i can't find a way to disable those elements that the user has already selected and the other thing is, when i make a multiselection how can i now which are the value of all the elements i selected and insert them all at ones in the other listbox??

Thank you for your attention.
 
Hi Rocket....

>My situation is that i can't find a way to disable those >elements that the user has already selected

I'm not sure you can disable them but you can use the removeitem to remove them.

>and the other thing is, when i make a multiselection how >can i now which are the value of all the elements i >selected and insert them all at ones in the other listbox??

There is an example of how to do this in the Docs. Chapter 10 Using Controls.... on page 11 if you print them out otherwise in the section about list boxs.

Good luck.


Tom Gahagan
edrest@alltel.net

REST



If you get a chance to sit out or dance...

I hope you dance. L Wommack
 
Look for 'Selected Property' in FoxPro's Help.
And dont forget to see the Example given.
 
When you want to disable an element in a Combobox or ListBox you just have to type "\" before the value you want to disable:

Try this...

Thisform.List1.AddItem("Item1")
Thisform.List1.AddItem("Item2")
Thisform.List1.AddItem("\Item3")

...and you'll se the third item disabled, but still in the list.

Edwin Dalorzo
edalorzo@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top