Beispiel #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;                             //name groupbox with selected animal category

            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
        }