public void SyncCrewNumber() { int totalCountCrew = 0; foreach (ComboBox derBox in numBoxes) { int derBoxCount = 0; if (derBox.SelectedItem == null) { derBoxCount = 0; } else { derBoxCount = Int32.Parse(derBox.SelectedItem.ToString()); } if (derBoxCount > 0) { totalCountCrew += derBoxCount; } } ConfigureCrewForm parentForm = (this.Parent as ConfigureCrewForm); if (parentForm == null) { return; } parentForm.shipCrewMenu1.NumberOfCrew.Text = totalCountCrew.ToString(); }
private void availableTalentBox_SelectedIndexChanged(object sender, EventArgs e) { int totalCountCrew = 0; foreach (ComboBox derBox in numBoxes) { int derBoxCount = 0; if (derBox.SelectedItem == null) { derBoxCount = 0; } else { derBoxCount = Int32.Parse(derBox.SelectedItem.ToString()); } if (derBoxCount > 0) { totalCountCrew += derBoxCount; } } ConfigureCrewForm parentForm = (this.Parent as ConfigureCrewForm); if (parentForm == null) { return; } parentForm.shipCrewMenu1.NumberOfCrew.Text = totalCountCrew.ToString(); }
private void configureCrewBut_Click(object sender, EventArgs e) { ConfigureCrewForm formMe = new ConfigureCrewForm(); MainForm theForm = (this.Parent as MainForm); formMe.Show(); formMe.SetPrevForm(theForm); formMe.shipCrewMenu1.SetPrevForm(theForm); if (theForm.theCrew.Count > 0) { formMe.CrewUpdateToOld(theForm.theCrew); } }
private void resetCrewButton_Click(object sender, EventArgs e) { ConfigureCrewForm theForm = (this.Parent as ConfigureCrewForm); theForm.crewInput1.ResetTheCrew(); }