Embed and use resource files. The following are all source code:
Using System;
Using System. Drawing;
Using System. Collections;
Using System. ComponentModel;
Using System. Windows. Forms;
Using System. Data;
Using System. Reflection;
Using System. IO;
Using System. Diagnostics;
Namespace ResourceDemo
{
/// <Summary>
/// Summary description for Form1.
/// </Summary>
Public class Form1: System. Windows. Forms. Form
{
ArrayList pics;
Private System. Windows. Forms. GroupBox groupBox1;
Private System. Windows. Forms. PictureBox pBox;
Private System. Windows. Forms. Button btnDisplay;
Private System. Windows. Forms. TextBox txtInfo;
/// <Summary>
/// Required designer variable.
/// </Summary>
Private System. ComponentModel. Container components = null;
Public Form1 ()
{
//
// Required for Windows Form Designer support
//
InitializeComponent ();
// Instantiate our ArrayList
Pics = new ArrayList ();
}
/// <Summary>
/// Clean up any resources being used.
/// </Summary>
Protected override void Dispose (bool disposing)
{
If (disposing)
{
If (components! = Null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
# Region Windows Form Designer generated code
/// <Summary>
/// Required method for Designer support-do not modify
/// The contents of this method with the code editor.
/// </Summary>
Private void InitializeComponent ()
{
This. pBox = new System. Windows. Forms. PictureBox ();
This. groupBox1 = new System. Windows. Forms. GroupBox ();
This. btnDisplay = new System. Windows. Forms. Button ();
This.txt Info = new System. Windows. Forms. TextBox ();
This. groupBox1.SuspendLayout ();
This. SuspendLayout ();
//
// PBox
//
This. pBox. BorderStyle = System. Windows. Forms. BorderStyle. FixedSingle;
This. pBox. Location = new System. Drawing. Point (8, 8 );
This. pBox. Name = "pBox ";
This. pBox. Size = new System. Drawing. Size (264,272 );
This. pBox. TabIndex = 0;
This. pBox. TabStop = false;
This. pBox. SizeMode = System. Windows. Forms. PictureBoxSizeMode. StretchImage;
//
// GroupBox1
//
This. groupBox1.Controls. AddRange (new System. Windows. Forms. Control [] {
This.txt Info,
This. btnDisplay });
This. groupBox1.Location = new System. Drawing. Point (288, 8 );
This. groupBox1.Name = "groupBox1 ";
This. groupBox1.Size = new System. Drawing. Size (192,264 );
This. groupBox1.TabIndex = 1;
This. groupBox1.TabStop = false;
//
// BtnDisplay
//
This. btnDisplay. Location = new System. Drawing. Point (48, 24 );
This. btnDisplay. Name = "btnDisplay ";