Advertisement
yepp

Untitled

Apr 16th, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication2
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void Form1_Load(object sender, EventArgs e) {
  21.             this.Width = 800;
  22.             List<PictureBox> bazinga = new List<PictureBox>(10);
  23.             for (int i = 0; i < 10; ++i) {
  24.                 bazinga.Add(new PictureBox());
  25.                 this.Controls.Add(bazinga[i]);
  26.                 bazinga[i].Size = new Size(this.Width/10-10, this.Width/10-10);
  27.                 bazinga[i].SizeMode = PictureBoxSizeMode.StretchImage;
  28.                 bazinga[i].Image = Image.FromFile("bazinga.png");
  29.                 bazinga[i].Location = new Point((this.Width/10)*i, 10);
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement