public ChampionContainer(Champion champion) { _champion = champion; pictureBox = new System.Windows.Forms.PictureBox(); toolTip = new System.Windows.Forms.ToolTip(); this.pictureBox.Image = HelpMethods.getImageFromLocalDirectory(champion.Image); this.pictureBox.Location = new System.Drawing.Point(0, 0); this.pictureBox.Name = "pictureBox"+champion.Name; this.pictureBox.Size = new System.Drawing.Size(60, 60); this.pictureBox.TabIndex = 0; this.pictureBox.TabStop = false; this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox.Visible = false; this.pictureBox.Click+=new EventHandler(pictureBox_Click); this.toolTip.SetToolTip(pictureBox, champion.Name); }
public void Add(Champion champion) { ChampionContainer newChampion; if(_mainForm==null) { newChampion = new ChampionContainer(champion); } else { newChampion = new ChampionContainer(champion, _mainForm); } if(_controlPanel!=null) { _controlPanel.Controls.Add(newChampion.PictureBox); } if(_contextMenu!=null) { newChampion.PictureBox.ContextMenuStrip = _contextMenu; } _listOfChampions.Add(newChampion); }