コード例 #1
0
        public EditTerrainForm(TemplateDoc tmpd)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            m_sizTile = tmpd.TileSize;
            for (int n = 0; n < m_abr.Length; n++)
            {
                m_abr[n] = new SolidBrush(s_aclrTerrain[n]);
            }

            Template[] atmpl = tmpd.GetTemplates();
            panel1.SuspendLayout();
            foreach (Template tmpl in atmpl)
            {
                PictureBox picb = new PictureBox();
                picb.Image      = ConstructTerrainBitmap(tmpl);
                picb.SizeMode   = PictureBoxSizeMode.AutoSize;
                picb.Tag        = (Object)tmpl;
                picb.MouseDown += new MouseEventHandler(PictureBox_MouseDown);
                panel1.Controls.Add(picb);
            }
            panel1.ResumeLayout();
        }
コード例 #2
0
 void FillPanel(ArrayList alsPictureBoxes)
 {
     flowPanel.SuspendLayout();
     flowPanel.Controls.Clear();
     flowPanel.Controls.AddRange((Control[])alsPictureBoxes.ToArray(typeof(Control)));
     flowPanel.ResumeLayout();
     flowPanel.RefreshScrollbar();
 }