private void Button1_Click(object sender, RoutedEventArgs e) { string addy = textbox1.Text; string namy = textbox2.Text; string zipy = textbox3.Text; int zipcode; if (string.IsNullOrWhiteSpace(addy) == true) { MessageBox.Show("You must enter an address"); } bool isint = Int32.TryParse(zipy, out zipcode); if (isint == false) { MessageBox.Show("must enter an integer value for zip code"); } EntryForm ef = new EntryForm(); ef.address = addy; ef.name = namy; ef.zip = zipcode; // ^^ does the same thing as above EntryForm ef = new EntryForm(namy,addy,zipcode); listbox1.Items.Add(ef); }
private void Submit_Click(object sender, RoutedEventArgs e) { string Namy = tb1.Text; string Addy = tb2.Text; string Zipy = tb3.Text; // equivalent to doing Console.ReadLine(); int ZipCode; if (string.IsNullOrWhiteSpace(Namy) == true) { MessageBox.Show("You must enter your full name"); } bool isInt = Int32.TryParse(Zipy, out ZipCode); if (isInt == false) { MessageBox.Show("Must enter integer value for ZipCode"); } /* Create an instance of the EntryForm object using the empty construtor * EntryForm ef = new EntryForm() * ef.Address = addy; * ef.Name = namy; * ef.ZipCode = Zip; */ // Create an instance of the EntryForm object EntryForm ef = new EntryForm(Namy, Addy, ZipCode); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { string address, name, zipCode; address = txtbxAddress.Text; name = txtbxName.Text; zipCode = txtbxZipCode.Text; int zipCodeAsInt; if (string.IsNullOrWhiteSpace(address) == true) { MessageBox.Show("Address is a required field."); } bool isInt = Int32.TryParse(zipCode, out zipCodeAsInt); if (isInt == false) { MessageBox.Show("Must enter an integer value for zip code."); } EntryForm newEntryForm = new EntryForm(name, address, Convert.ToInt32(zipCode)); lstbxEntryForms.Items.Add(newEntryForm); ClearAllTextBoxes(); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { EntryForm entryForm = new EntryForm(txtName.Text, txtAddress.Text, Convert.ToInt32(txtZip.Text)); //EntryForm(txtName.Text, txtAddress.Text, Convert.ToInt32(txtZip.Text)) listApps.Items.Add(entryForm); }
private void Button_Click(object sender, RoutedEventArgs e) { EntryForm ef = new EntryForm(); ef.Name = tbx1.Text; ef.Address = tbx2.Text; ef.ZipCode = Convert.ToInt32(tbx3.Text); listbox.Items.Add(ef); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { string name; string address; int ZipCode; name = txtName.Text; address = txtAddress.Text; ZipCode = Convert.ToInt32(txtZipCode.Text); EntryForm forms = new EntryForm(name, address, ZipCode); lstBox.Items.Add(forms); }
private void btnEnter_Click(object sender, RoutedEventArgs e) { //Retrieve information the user enters into the text boxes. string name = txtName.Text; string address = txtAddress.Text; int zipCode = txtZipCode.PersistId; //Call the EntryForm class, using the following object: EntryForm entry = new EntryForm(name, address, zipCode); lstUserInfo.Items.Add(entry.name + " " + entry.address + " " + entry.zipCode); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { name = txtName.Text; address = txtAddress.Text; zipCode = txtZip.Text; EntryForm entryForm = new EntryForm(name, address, Convert.ToInt32(zipCode)); lstBox.Items.Add($"Name: {name} Address: {address} Zipcode: {zipCode}"); txtAddress.Text = string.Empty; txtName.Text = string.Empty; txtZip.Text = string.Empty; }
private void btnAdd_Click(object sender, RoutedEventArgs e) { EntryForm Entry = new EntryForm(); Entry.Name = txtName.Text; Entry.Address = txtAddress.Text; Entry.ZipCode = Convert.ToInt32(txtZip.Text); LBoxApplicants.Items.Add(Entry); txtName.Clear(); txtAddress.Clear(); txtZip.Clear(); txtName.Focus(); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { EntryForm entry = new EntryForm(); //assigns user entry to variables entry.Name = txtName.Text; entry.Address = txtAddress.Text; entry.ZipCode = Convert.ToInt32(txtZipcode.Text); //creates the application and adds it to a list applications.Add(entry); lstApplications.Items.Add(entry.ToString()); //clear textboxes so user can enter another application txtName.Clear(); txtAddress.Clear(); txtZipcode.Clear(); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { EntryForm instance = new EntryForm(txtName.Text, txtAddress.Text, Convert.ToInt32(txtZip.Text)); lst.Items.Add(instance); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { EntryForm newEntry = new EntryForm(txtName.Text, txtAddress.Text, Convert.ToInt32(txtZip.Text)); lstApplications.Items.Add(newEntry); }
private void btn_Submit_Click(object sender, RoutedEventArgs e) { EntryForm Applicant = new EntryForm(txtbx_Name.Text, txtbx_Address.Text, Convert.ToInt32(txtbx_Zipcode.Text)); lbx_ApplicantInfo.Items.Add(Applicant.ToString()); }