private void cboDVD_SelectedIndexChanged(object sender, EventArgs e) { //if resetting combo, ignore if (cboDVD.SelectedIndex == -1) { return; } //find DVD Details DVD updDVD = new DVD(); updDVD.getDVD(Convert.ToInt32(cboDVD.Text.Substring(0, 3))); if (updDVD.getDVDId().Equals(0)) { MessageBox.Show("No details found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtDVDId.Focus(); return; } //display DVD details txtDVDId.Text = updDVD.getDVDId().ToString("000"); txtDVDTitle.Text = updDVD.getTitle(); txtDVDDescription.Text = updDVD.getDescription(); txtDVDYearRelease.Text = updDVD.getYear().ToString(); txtRateCode.Text = updDVD.getRateCode(); //display details grpDVD.Visible = true; }