private PictureBox addLevelToPanel(Level level) { PictureBox levelCell; levelCell = new PictureBox(); levelCell.Click += new EventHandler(levelCell_Click); levelCell.Tag = level; if (version.CPU == CPUVersion.ZX) { updateTiles(level); } viewer.ImageList = imageList; if (level.Equals(selectedLevel)) { levelCell.BorderStyle = BorderStyle.Fixed3D; } else { levelCell.BorderStyle = BorderStyle.None; } int cellWidth = this.ClientRectangle.Width - layoutPanel.Padding.Left - layoutPanel.Padding.Right - 4 - SystemInformation.VerticalScrollBarWidth; levelCell.Size = new Size(cellWidth, cellWidth); levelCell.SizeMode = PictureBoxSizeMode.StretchImage; viewer.Level = level; levelCell.Image = viewer.GetPreview(); levelCell.Visible = true; layoutPanel.Controls.Add(levelCell); return(levelCell); }
private void removeLevelFromPanel(Level selectedLevel) { PictureBox pBoxToRemove = null; foreach (PictureBox pBox in layoutPanel.Controls) { if (selectedLevel.Equals(pBox.Tag)) { pBoxToRemove = pBox; break; } } if (pBoxToRemove != null) { layoutPanel.Controls.Remove(pBoxToRemove); } }
private PictureBox addLevelToPanel(Level level) { PictureBox levelCell; levelCell = new PictureBox(); levelCell.Click += new EventHandler(levelCell_Click); levelCell.Tag = level; if (version.CPU == CPUVersion.ZX) { updateTiles(level); } viewer.ImageList = imageList; if (level.Equals(selectedLevel)) { levelCell.BorderStyle = BorderStyle.Fixed3D; } else { levelCell.BorderStyle = BorderStyle.None; } int cellWidth = this.ClientRectangle.Width - layoutPanel.Padding.Left - layoutPanel.Padding.Right - 4 - SystemInformation.VerticalScrollBarWidth; levelCell.Size = new Size(cellWidth, cellWidth); levelCell.SizeMode = PictureBoxSizeMode.StretchImage; viewer.Level = level; levelCell.Image = viewer.GetPreview(); levelCell.Visible = true; layoutPanel.Controls.Add(levelCell); return levelCell; }