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
Post a Comment