Embed and use resource files in. NET

Source: Internet
Author: User

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 ";

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.