Пример #1
0
        /// <summary>
        /// When Animal Category is selected display groupbox for category specific info.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lstAnimalCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbxAnimalCategory.Visible = true; //make groupbox visible
            gbxAnimalCategory.Text    = lstAnimalCategory.Text;

            lstSpecies.DataSource    = AnimalMaker.GetSpeciesNames(lstAnimalCategory.Text); //populate Species listbox
            lstSpecies.SelectedIndex = -1;                                                  //unselect

            if (lstAnimalCategory.Text != "all")
            {
                lblAnimalCatInfo.Text = AnimalMaker.LabelText(lstAnimalCategory.Text); //label for animal category specific info
            }
            gbxSpecies.Visible = false;                                                //hide groupbox
        }
Пример #2
0
        /// <summary>
        /// When Species is selected, display groupbox for species specific info.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lstSpecies_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbxSpecies.Text     = lstSpecies.Text;                        // groupbox name
            lblSpeciesInfo.Text = AnimalMaker.LabelText(lstSpecies.Text); //label for species specific info

            //if Animal Category "all" is selected, species selection generates groupbox name and
            //label for animal category specific info.
            if (lstAnimalCategory.Text == "all")
            {
                gbxAnimalCategory.Text = AnimalMaker.GroupBoxName(lstSpecies.Text);
                lblAnimalCatInfo.Text  = AnimalMaker.AnimalCategoryInfoWhenAnimalSelected(lstSpecies.Text);
            }
            gbxSpecies.Visible = true; //make groupbox visible
        }