Exemplo n.º 1
0
        void comboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            var pokeId = PokemonId.Missingno;

            Enum.TryParse <PokemonId>(comboBox1.SelectedValue.ToString(), out pokeId);
            var pokemonImage = PokeImgManager.GetPokemonLargeImage(pokeId);

            PokemonImage.Image = pokemonImage;
        }
Exemplo n.º 2
0
        private void createImageList()
        {
            const int imageSize = 50;
            var       imageList = new ImageList {
                ImageSize = new Size(imageSize, imageSize)
            };

            foreach (PokemonId pokemon in Enum.GetValues(typeof(PokemonId)))
            {
                Bitmap pokemonImage = PokeImgManager.GetPokemonLargeImage(pokemon);
                if (pokemonImage != null)
                {
                    imageList.Images.Add(pokemon.ToString(), pokemonImage);
                }
            }
            PokemonListView.SmallImageList = imageList;
            PokemonListView.LargeImageList = imageList;
        }