forked from mono/winforms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswf-picturebox.cs
37 lines (28 loc) · 1.23 KB
/
swf-picturebox.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Drawing;
using System.Windows.Forms;
namespace System.Windows.Forms {
public class PictureBoxDemo : Form {
public PictureBoxDemo ()
{
PictureBox box = null;
for (int r = 0; r < 3; r++) {
for (int c = 0; c < 3; c++) {
box = new PictureBox ();
box.SizeMode = PictureBoxSizeMode.AutoSize;
box.Image = Image.FromFile ("roxy.jpg");
box.Left = 10 + c * box.Image.Width + (c * 10);
box.Top = 10 + r * box.Image.Height + (r * 10);
Controls.Add (box);
}
}
Width = box.Right + 10;
Height = box.Bottom + 10;
}
public static void Main ()
{
System.Threading.Thread.CurrentThread.Name = "Main Thread";
Application.Run (new PictureBoxDemo ());
}
}
}