Exemple #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     db = new MonsterDB();
     MonsterCard monster = db.FindMonsterCard(1746);
     textBox1.Text = monster.Image40.HRef;
     textBox2.Text = monster.Image60.HRef;
     pictureBox1.Width = 60;
     pictureBox1.Height = 60;
     this.AcceptButton = button1;
 }
        public MonsterSelect(MonsterDB DB)
        {
            db = DB;
            this.Width = 500;
            this.Height = 600;
            MonsterSelection = null;

            monsterSearchBox = new TextBox();
            monsterSearchBox.Left = this.Padding.Left;
            monsterSearchBox.Width = this.ClientSize.Width;       
            this.Controls.Add(monsterSearchBox);

            searchButton = new Button();
            searchButton.Top = -20;
            searchButton.Left = 0;
            this.Controls.Add(searchButton);
            this.AcceptButton = searchButton;
            searchButton.Click += SearchButton_Click;
                        
            monsterImages = new ImageList();
            monsterImages.ImageSize = new Size(60, 60);

            monsterSelectionView = new ListView();
            monsterSelectionView.Top = monsterSearchBox.Top + monsterSearchBox.Height;
            monsterSelectionView.Width = this.ClientSize.Width;
            monsterSelectionView.Height = this.ClientSize.Height - monsterSearchBox.Height;
            monsterSelectionView.SmallImageList = monsterImages;
            monsterSelectionView.View = View.Details;
            var Column1 = monsterSelectionView.Columns.Add("Monsters", monsterSelectionView.ClientSize.Width, HorizontalAlignment.Left);
            //monsterSelectionView.Columns.Add("Name",monsterSelectionView.ClientSize.Width - 62);
            monsterSelectionView.MultiSelect = false;
            monsterSelectionView.Activation = ItemActivation.OneClick;
            monsterSelectionView.ItemActivate += MonsterSelectionView_SelectedIndexChanged;
            //monsterSelectionView.SelectedIndexChanged += MonsterSelectionView_SelectedIndexChanged;
            this.Controls.Add(monsterSelectionView);
        }