arrays - I'm trying to make a simple invoice program working (EDP) -


the program simple, asks first , last name of user along 3 other interactive user input elements. when user types in first , last name should use array , send name combobox via click of button. @ moment don't know how send user typed values combox using array.

below code have right now:

public class form1      dim people(20) string     dim peopleindex integer     dim firstname string     dim lastname string     dim blngroup boolean     dim numberofadult integer     dim numberofchild integer      private sub form1_load(sender object, e system.eventargs) handles me.load         peopleindex = -1     end sub      private sub btnaddcustomer_click(sender system.object, e system.eventargs) handles btnaddcustomer.click         peopleindex += 1         if peopleindex > ubound(people)             redim preserve people(peopleindex + 10)         end if     end sub end class 

not sure if want might @ least give idea of how use array.

so first of all, declare global list of string this:

dim people new list(of string) 

then add combobox, textbox , button form.

now try this:

private sub btnaddcustomer_click(sender object, e eventargs) handles btnaddcustomer.click      '' add textbox1's text list of strings , combobox     people.add(textbox1.text)     combobox1.items.add(textbox1.text)  end sub  private sub btndelcustomer_click(sender object, e eventargs) handles btndelcustomer.click      '' remove selected item list of strings     people.remove(combobox1.selecteditem)     '' after delete, repopulate combobox     combobox1.items.clear()     each person in people         combobox1.items.add(person)     next  end sub 

make sure name second button 'btndelcustomer' or change event handler. again, i'm not clear on want if need more information, ask.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -