private void btnTheButton_Click(object sender, RoutedEventArgs e)
        {
            EntryForm myEntryForm = new EntryForm
            {
                Name    = tbxName.Text,
                Address = tbxAddress.Text,
                ZipCode = Convert.ToInt32(tbxZipcode.Text),
            };

            lbxTheListBox.Items.Add(myEntryForm);
        }
Exemplo n.º 2
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            EntryForm form = new EntryForm();

            form.Name    = txtName.Text;
            form.Address = txtAddress.Text;
            form.ZipCode = Convert.ToInt32(txtZip.Text);

            lstForms.Items.Add(form);

            txtAddress.Text = string.Empty;
            txtName.Text    = string.Empty;
            txtZip.Text     = string.Empty;
        }