vb.net - Adding array of strings and array of doubles in a combobox -


i need add array of strings array of doubles.

public class form1     dim items() string = {"beef", "chicken", "lamb"}     dim itemcosts() double = {7, 4, 3}      private sub button1_click(sender object, e eventargs) handles btn_starttest.click         cmb_test.items.addrange(items + items)     end sub end class 

it returns error cannot add 2 strings.

the + operator doesn't @ want array. news here you're working combobox, wants strings. means can this:

cmb_test.items.addrange(items.concat(itemcosts.select(i=>i.tostring())).toarray()) 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -