private void mnuView_Click(object sender, EventArgs e) { frmRecord rec = new frmRecord(); //hides current form this.Hide(); //displays the record form rec.Show(); //disables textboxes rec.txtFirstName.Enabled = false; rec.txtLastName.Enabled = false; rec.txtStreet.Enabled = false; rec.txtCity.Enabled = false; rec.txtState.Enabled = false; rec.txtZip.Enabled = false; rec.txtPhone.Enabled = false; rec.txtEmail.Enabled = false; //disables the previous button rec.btnPrevious.Enabled = false; //hides ok button rec.btnOK.Hide(); //calls display the data from the person to textboxes rec.display(); //updates the label that countd the current person rec.lblRecordCounter.Text = Data._recCurrent + 1 + " of " + Data._lstPer.Count; }
private void mnuDelete_Click(object sender, EventArgs e) { frmRecord rec = new frmRecord(); //sets form title rec.Text = "Delete"; //hides current form this.Hide(); //displays the record form rec.Show(); //change thje name of close button rec.btnOK.Text = "Delete"; //change close text to cancel rec.btnClose.Text = "Cancel"; //updates the label that countd the current person rec.lblRecordCounter.Text = Data._recCurrent + 1 + " of " + Data._lstPer.Count; //calls display the data from the person to textboxes rec.display(); }
private void mnuAdd_Click(object sender, EventArgs e) { frmRecord rec = new frmRecord(); //sets the title of the form rec.Text = "Add Data"; //sets the number of the new person Data.newPerNum = Data._lstPer.Count + 1; //hides current form this.Hide(); //displays the record form rec.Show(); //hides previous button rec.btnPrevious.Hide(); //hides ok button rec.btnOK.Hide(); //changes the close button to Add rec.btnNext.Text = "Add"; //sets the count label rec.lblRecordCounter.Text = Data.newPerNum + " of " + Data.newPerNum; }