コード例 #1
0
        private void BttnEnter_Click(object sender, RoutedEventArgs e)
        {
            EntryForm NewEntry = new EntryForm();

            NewEntry.Name    = TxtBxName.Text;
            NewEntry.Address = TxtBxAddress.Text;
            NewEntry.ZipCode = Convert.ToInt32(TxtBxZip.Text);

            LBEntries.Items.Add(NewEntry);

            TxtBxName.Text    = "Enter Name Here";
            TxtBxAddress.Text = "Enter Address Here";
            TxtBxZip.Text     = "Enter ZipCode Here";
        }
コード例 #2
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            EntryForm newform = new EntryForm()
            {
                Name    = txtName.Text,
                Address = txtAddress.Text,
                ZipCode = Convert.ToInt32(txtZip.Text)
            };

            lstinfo.Items.Add(newform);

            txtAddress.Text = string.Empty;
            txtName.Text    = string.Empty;
            txtZip.Text     = string.Empty;
        }
        private void btnapplication_Click(object sender, RoutedEventArgs e)
        {
            txtname.Text    = "";
            txtaddress.Text = "";
            txtzipcode.Text = "";

            ListBox   ListBox1  = new ListBox();
            EntryForm Userentry = new EntryForm();

            Userentry.Name    = txtname.Text;
            Userentry.Address = txtaddress.Text;
            Userentry.ZipCode = Convert.ToInt32(txtzipcode.Text);

            ListBox1.Items.Add(Userentry);

            //I know this doesn't work, but I have spent a good 10 hours trying different things and I have two tests to study for. I am feeling defeated.
        }