winforms - How do you create a Listbox on the fly (at runtime) in VB.net? -


i'm attempting create listbox when button clicked in visual basic 2008. can't seem find code works this. found few examples similar , said work:

dim lstoutput listbox  lstoutput = me.controls.add("vb.label", "list1") 

problem both of things inside parenthesis generate errors:

for first one:

value of type 'string' cannot converted 'system.windows.forms.control'.

and second one:

too many arguments 'public overridable sub add(value system.windows.forms.control)'.

any ideas?

this add empty listbox last control in page:

dim lstoutput new listbox { .id = "list1" } page.controls.add(lstoutput) 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -