home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / FL_graphic_cs________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Text File  |  2001-08-21  |  1.8 KB  |  70 lines

  1. namespace Demo.Graphics {
  2.     
  3.     using System;
  4.     using System.Drawing;
  5.     using System.ComponentModel;
  6.     using System.Windows.Forms;
  7.     using System.IO;
  8.     using System.Reflection;
  9.     using System.Resources;
  10.     using System.Globalization;
  11.     using System.Threading;
  12.     
  13.     public class Images : System.Windows.Forms.Form {
  14.  
  15.         private System.ComponentModel.Container components;
  16.         private System.Windows.Forms.PictureBox pictureBox1;
  17.  
  18.         private ResourceManager rm;
  19.          
  20.         public Images(string culture) {
  21.             if (culture != "") 
  22.                 try {
  23.                     Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
  24.                 }
  25.                 catch (ArgumentException e){
  26.                     MessageBox.Show(this, e.Message, "Bad command-line argument");
  27.                 }
  28.             InitializeComponent();
  29.         }
  30.  
  31.         protected override void Dispose(bool disposing) {
  32.             if (disposing){
  33.                 if (components != null) {
  34.                     components.Dispose();
  35.                        }
  36.             }
  37.             base.Dispose(disposing);
  38.         }
  39.  
  40.  
  41.         [System.STAThreadAttribute()]
  42.         public static void Main(string[] args) {
  43.             string strCulture = "";
  44.             if (args.Length == 1) {
  45.                 strCulture = args[0];
  46.             }
  47.             Application.Run(new Images(strCulture));
  48.         }
  49.  
  50.         private void InitializeComponent() {
  51.  
  52.             rm = new ResourceManager("Images", this.GetType().Assembly);
  53.             
  54.             this.components = new System.ComponentModel.Container();
  55.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  56.             this.Size = new System.Drawing.Size(100, 100);
  57.             this.pictureBox1 = new System.Windows.Forms.PictureBox();
  58.             
  59.             pictureBox1.Location = new System.Drawing.Point(0, 0);
  60.             pictureBox1.Size = new System.Drawing.Size(100, 100);
  61.             pictureBox1.TabIndex = 0;
  62.             pictureBox1.TabStop = false;
  63.             
  64.             pictureBox1.Image = (System.Drawing.Image)rm.GetObject("flag");
  65.             
  66.             this.Controls.Add(pictureBox1);
  67.         }
  68.     }
  69. }
  70.