View Full Version : dotNet listbox.add problem in max 2008

02 February 2009, 10:41 PM
How, can I add items to the dotNet listbox in max 2008? In max 2009 its very simple and its goes something like this:

ListItems = #("Item1", "Item2", "Item3", "Item4", "Item15")
dotNetControl lv "System.Windows.Forms.Listbox"
lv.items.addrange listitems

But in max 2008 and max 9 this method doesn't work. Its says "No method found which matched argument list"
Anyone knows how to add those items to listbox?

02 February 2009, 07:12 AM
in max 9 / 2008 you need to supply a system.string rather than a max string so your code would be stringArray = #("Item1", "Item2", "Item3", "Item4", "Item15")
ListItems = for s in stringArray collect dotNetObject "System.String" s
dotNetControl lv "System.Windows.Forms.Listbox"
lv.items.addrange listitemsit's annoying but if your coding for pre-2009 then that's the way you have to do it

02 February 2009, 07:20 AM
Thanks, for your reply.
I have just found this solution, and I was writing it, but you were faster. Thanks again for answer :)

CGTalk Moderation
02 February 2009, 07:20 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.