// private void btnHakuKoe_Click(object sender, EventArgs e) { if (tbKoe.Text != "") { tbKoe.Text = KoeVar; KoeListForm koeListForm = new KoeListForm(Kokeet, KoeVar, KoeidC, KoeAlt); KoeVar = koeListForm.KoeVar; koeListForm.ShowDialog(); this.Show(); try { gbKoe.Enabled = true; var Sko = koeListForm.SelectedKoe; populateFormKoe(Sko); // tbKoeNimi.Text = TVar; VastausListForm vastausListForm = new VastausListForm(Tulokset, TVar, VidC, VAlt); TVar = vastausListForm.TVar; vastausListForm.ShowDialog(); this.Show(); var Sv = vastausListForm.SelectedV; populateFormV(Sv); } catch { gbKoe.Enabled = false; } } else { MessageBox.Show("Haku on tyhjä!", "Virhe", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
// private void btnHakuKoe_Click(object sender, EventArgs e) { if (tbKoe.Text != "") { tbKoe.Text = KoeVar; KoeListForm koeListForm = new KoeListForm(Kokeet, KoeVar, KoeidC, KoeAlt); KrVar = koeListForm.KoeVar; koeListForm.ShowDialog(); this.Show(); try { gbKoe.Enabled = true; var Sko = koeListForm.SelectedKoe; populateFormKr(Sko); } catch { gbKoe.Enabled = false; } } else { MessageBox.Show("Haku on tyhjä!", "Virhe", MessageBoxButtons.OK, MessageBoxIcon.Error); } }