-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPictureBox.cs
More file actions
27 lines (23 loc) · 883 Bytes
/
PictureBox.cs
File metadata and controls
27 lines (23 loc) · 883 Bytes
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
using System.IO;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "PictureBox example";
ClientSize = new System.Drawing.Size(300, 300);
pictureBox1.Parent = this;
pictureBox1.BorderStyle = BorderStyle.FixedSingle;
pictureBox1.Location = new System.Drawing.Point(20, 20);
pictureBox1.Size = new System.Drawing.Size(260, 260);
pictureBox1.ImageLocation = "c:\\logo.bmp";
pictureBox1.Image = Examples.Properties.Resources.Logo;
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
pictureBox1.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
}
private PictureBox pictureBox1 = new PictureBox();
}
}