public int addItem(int appNumber)
        {
            getFiles(appNumber);
            getIcon(appNumber);
            pictureBox2 = new System.Windows.Forms.PictureBox[files.Length];
            flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel[files.Length];
            label = new System.Windows.Forms.Label[fileNames.Length];
            flow = System.Windows.Forms.FlowDirection.TopDown;
            img = (System.Drawing.Image)bitmap;

            for (int i = 0; i < files.Length; i++)
            {
                flowLayoutPanel2[i] = new System.Windows.Forms.FlowLayoutPanel();
                flowLayoutPanel2[i].AutoSize = false;
                flowLayoutPanel2[i].FlowDirection = flow;
                pictureBox2[i] = new System.Windows.Forms.PictureBox();
                pictureBox2[i].Image = img;
                pictureBox2[i].Size = size;
                pictureBox2[i].Parent = this.flowLayoutPanel2[i];
                this.flowLayoutPanel2[i].Size = size;
                label[i] = new System.Windows.Forms.Label();
                label[i].ForeColor = System.Drawing.Color.White;
                label[i].Text = fileNames[i];
                label[i].AutoSize = true;
                label[i].Parent = this.flowLayoutPanel2[i];
                this.flowLayoutPanel2[i].Parent = this.flowLayoutPanel1;
            }
            return files.Length;
        }//end of addItem
Example #2
0
 public void AddControlsIntoGroupBox(System.Windows.Forms.GroupBox gb, System.Windows.Forms.FlowDirection dir)
 {
     this.panel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.panel.Controls.Add(this.txt);
     this.panel.FlowDirection = dir;
     foreach (System.Windows.Forms.RadioButton rb in this.radioButtons)
     {
         panel.Controls.Add(rb);
     }
     gb.Controls.Add(panel);
 }