Beispiel #1
0
        private void BtnPersonClick(object sender, EventArgs e)
        {
            try
            {
                string        name   = tbPersonName.Text;
                int           age    = Convert.ToInt32(tbPersonAge.Text);
                PersonWrapper person = new PersonWrapper(name, age);

                //Properties work
                person.Name = tbPersonName.Text;

                tbPersonOutput.Text = person.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }