/// <summary> /// fills out the selection details whenever the selection changes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MoviesComboBox_SelectedIndexChanged(object sender, EventArgs e) { TitleTextBox.Text = MoviesComboBox.Text; CheckCategory(); CheckCost(); string imageString = Regex.Replace(TitleTextBox.Text, @"\s+", ""); YourSelectionPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageString); YourSelectionPictureBox.Refresh(); NextButton.Enabled = true; }
/// <summary> /// retrieves selected movie, displays its details and calculates costs /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OrderForm_Load(object sender, EventArgs e) { String[] movie = Program.movie; TitleTextBox.Text = movie[0]; CategoryTextBox.Text = movie[1]; CostTextBox.Text = movie[2]; string imageString = Regex.Replace(TitleTextBox.Text, @"\s+", ""); YourSelectionPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageString); YourSelectionPictureBox.Refresh(); CalcTotal(); }
/// <summary> /// checks if a movie has been previously selected and displays its details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SelectionForm_Load(object sender, EventArgs e) { String[] movie = Program.movie; if (movie[0] == null) { NextButton.Enabled = false; } else { TitleTextBox.Text = movie[0]; CategoryTextBox.Text = movie[1]; CostTextBox.Text = movie[2]; string imageString = Regex.Replace(TitleTextBox.Text, @"\s+", ""); YourSelectionPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageString); YourSelectionPictureBox.Refresh(); NextButton.Enabled = true; } }