Csharp/C Sharp/GUI Windows Form/Unicode Display

Материал из .Net Framework эксперт
Версия от 14:33, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Unicode encoding:

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // Portuguese
        char[] portuguese = {"\u0053", "\u0065", "\u006A", 
                               "\u0061", "\u0020", "\u0062", "\u0065", "\u006D",
                               "\u0020", "\u0076", "\u0069", "\u006E", "\u0064",  
                               "\u006F", "\u0020", "\u0061", "\u0020" };                   
        myLabel.Text = new string(portuguese) + "Unicode" + "\u0021";
     }
  }
          
      </source>


Unicode encoding: English

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // English
        char[] english = {"\u0057", "\u0065", "\u006C",  
                            "\u0063", "\u006F", "\u006D", "\u0065", "\u0020",
                            "\u0074", "\u006F", "\u0020" };
        myLabel.Text = new string(english) + "Unicode" + "\u0021";
     }
  }
          
      </source>


Unicode encoding: French

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // French
        char[] french = { "\u0042", "\u0069", "\u0065", 
                           "\u006E", "\u0076", "\u0065", "\u006E", "\u0075",
                           "\u0065", "\u0020", "\u0061", "\u0075", "\u0020" };
        myLabel.Text = new string(french) + "Unicode" + "\u0021";
     }
  }
          
      </source>


Unicode encoding: German

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // German
        char[] german = {"\u0057", "\u0069", "\u006C", 
                           "\u006B", "\u006F", "\u006D", "\u006D", "\u0065",
                           "\u006E", "\u0020", "\u007A", "\u0075", "\u0020"};
        myLabel.Text = new string(german) + "Unicode" + "\u0021";
     }
  }


      </source>


Unicode encoding: implified Chinese

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // Simplified Chinese
        char[] chinese = {"\u6B22", "\u8FCE", "\u4F7F", 
                            "\u7528", "\u0020" };                   
        myLabel.Text = new string(chinese) + "Unicode" + "\u0021";
     }
  }
          
      </source>


Unicode encoding: Japanese

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // Japanese
        char[] japanese = { "\u3078",  "\u3087", "\u3045",
                             "\u3053", "\u305D", "\u0021"};                    
        myLabel.Text = new string(japanese) + "Unicode" + "\u0021";
     }
  }
          
      </source>


Unicode encoding: Russian

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // Russian
        char[] russian = {  "\u0414", "\u043E", "\u0431", 
                            "\u0440", "\u043E", "\u0020", "\u043F", "\u043E", 
                            "\u0436", "\u0430", "\u043B", "\u043E", "\u0432",
                            "\u0430", "\u0442", "\u044A", "\u0020", "\u0432", 
                            "\u0020" };                   
        myLabel.Text = new string(russian) + "Unicode" + "\u0021";
     }
  }


      </source>


Unicode encoding: Spanish

<source lang="csharp">

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ruponentModel;
  using System.Windows.Forms;
  using System.Data;
  public class Unicode : System.Windows.Forms.Form {
     System.Windows.Forms.Label  myLabel = new System.Windows.Forms.Label();
     public Unicode()
     {
        this.SuspendLayout();
        this.myLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        this.myLabel.Location = new System.Drawing.Point(20, 20);
        this.myLabel.Size = new System.Drawing.Size(800, 800);
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(800, 200);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {this.myLabel});
        this.Name = "Unicode";
        this.Text = "Unicode";
        this.Load += new System.EventHandler(this.Unicode_Load);
        this.ResumeLayout(false);
     }
     [STAThread]
     static void Main() 
     {
        Application.Run(new Unicode());
     }
     private void Unicode_Load(object sender, System.EventArgs e)
     {
        // Spanish
        char[] spanish = {"\u0042", "\u0069", "\u0065", 
                          "\u006E", "\u0076", "\u0065", "\u006E", "\u0069", 
                          "\u0064", "\u006F", "\u0020", "\u0061", "\u0020" };                  
        myLabel.Text = new string(spanish) + "Unicode" + "\u0021";
     }
  }
          
      </source>