public void CreateNewItem(Image image, AmusementsFactory click) { Panel p = new Panel(); p.Parent = this; p.Width = 90; p.Height = 120; if (lastItem != null) { if (lastItem.Right + p.Width <= this.Width) { p.Top = lastItem.Top; p.Left = lastItem.Right; } else { p.Top = lastItem.Bottom; p.Left = 0; } } else { p.Top = 10; p.Left = 0; } lastItem = p; Label l = new Label(); l.Parent = p; l.Text = click.name; l.TextAlign = ContentAlignment.TopCenter; l.AutoSize = false ; l.Top = 5; l.Left = 0; l.Width = 90; l.Height = 15; Button b = new Button(); b.Parent = p; b.Width = 70; b.Height = 70; b.BackgroundImage = image; b.BackgroundImageLayout = ImageLayout.Zoom; b.Tag = click; b.Top = 25; b.Left = 10; b.Click +=new System.EventHandler(this.Click); l = new Label(); l.Parent = p; l.Text = Labels.prize+click.prize.ToString(); l.TextAlign = ContentAlignment.TopCenter; l.Height = 15; l.Top = 100; l.Left = 0; l.Width = 90; }
public void Set(AmusementsFactory click, Image image) { this.Text = click.name; this.info_label.Text = click.GetInfo(); this.pictureBox.Image = image; this.pictureBox.Width = image.Width; this.pictureBox.Height = image.Height; this.pictureBox.BackColor = color; this.build_button.Tag = click; if (click is RectangleAmusementsFactory) { rectangleA_button.Visible = true; isHorizontal = true; } else rectangleA_button.Visible = false; }