[IronPython] How to find import in ipy

Ken MacDonald drken567 at gmail.com
Thu Mar 11 18:11:21 CET 2010


Hi, I have an app with a popup containing a listbox. I want to dynamically
add a few items to the listbox and found code in a number of places which
does something like:

            listbox.Items.Add(ListItem("Special", 11))
            listbox.Items.Add(ListItem("Regular", 19))

However, I can't find the proper import so that it finds ListItem. On MSDN
it shows as being in

from System.Web.UI.WebControls import ListItem

but I get "can't import UI"

So, anyone know how to do this?

Also, I'm concerned that next time (if I ever get it working first time) I
come to this popup, it will contain the items I had added previously; how
does one go about clearing the whole listbox?
Thanks,
Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100311/0ab7f0e1/attachment.html>


More information about the Ironpython-users mailing list