PDA

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


pchela1313
02-09-2009, 09: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?

Gravey
02-10-2009, 06: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

pchela1313
02-10-2009, 06: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-10-2009, 06: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.