Listbox keeps filling up with more items each time command button is pushed
Posted on 2005-05-17
My Listbox keeps filling up with more items each time the command button is pushed.
All i want to happen is for the user to select an item and click the command button to process a procedure.
Yet, each time a button is pushed all of the items in page load keep getting added to the listbox
Here's whats in the page load:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ListBox1.Items.Add("Add an Account")
ListBox1.Items.Add("Update an Account")
ListBox1.Items.Add("View an Account")
Here's whats in the command button:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Answer = ListBox1.SelectedValue
Can anyone clue me in?