Exemplo n.º 1
0
        private void SeeFish_Click(object sender, EventArgs e)
        {
            // Make sure a Fish is selected
            if (listBoxFish.SelectedIndex >= 0)
            {
                string selectedFish = listBoxFish.SelectedItem.ToString().Trim();
                // Open the form as a dialog
                FormSeeFish  formFish = new FormSeeFish(selectedFish);
                DialogResult result   = formFish.ShowDialog();

                // Check the dialog result
                if (result == DialogResult.OK)
                {
                    //if (formFish._SelectedFish == );
                }
                else
                {
                    MessageBox.Show("No fish selected - dialog cancelled");
                }
            }
            else
            {
                MessageBox.Show("Please selecte a fish", "Attention");
            }
        }
Exemplo n.º 2
0
        private void buttonSeeFish_Click(object sender, EventArgs e)
        {
            if (radioButtonCrappie.Checked)
            {
                FishToSee = "Crappie";
            }
            else if (radioButtonPerch.Checked)
            {
                FishToSee = "Perch";
            }
            else if (radioButtonWalleye.Checked)
            {
                FishToSee = "Walleye";
            }

            FormSeeFish  Create = new FormSeeFish(FishToSee);
            DialogResult result = Create.ShowDialog();

            if (result == DialogResult.Yes)
            {
                MessageBox.Show("Decision is to keep it", "Decision Result");
            }
            else if (result == DialogResult.OK)
            {
                MessageBox.Show("Decision is to Throw it back", "Decision Result");
            }
            else
            {
                MessageBox.Show("Decision canceled");
            }
        }