📄 control1.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Full
{
/// <summary>
/// Control1 的摘要说明。
/// </summary>
public class Control1 : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Control1()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
// TODO: 在 InitializeComponent 调用后添加任何初始化
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(0, 56);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "原始字符串:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(0, 88);
this.label2.Name = "label2";
this.label2.TabIndex = 1;
this.label2.Text = "返序字符串:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(0, 120);
this.label3.Name = "label3";
this.label3.TabIndex = 2;
this.label3.Text = "顺序字符串:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(104, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(208, 21);
this.textBox1.TabIndex = 3;
this.textBox1.Text = "textBox1";
this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(104, 88);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(208, 21);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "textBox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(104, 120);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(208, 21);
this.textBox3.TabIndex = 5;
this.textBox3.Text = "textBox3";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 16);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(256, 23);
this.label4.TabIndex = 6;
this.label4.Text = "原始字符串:\"栏中输入字符串,单击Tab";
//
// Control1
//
this.Controls.Add(this.label4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "Control1";
this.Size = new System.Drawing.Size(328, 152);
this.ResumeLayout(false);
}
#endregion
private void textBox1_Leave(object sender, System.EventArgs e)
{
string str = this.textBox1.Text;
char[] charArray = str.ToCharArray();
Array.Reverse(charArray);
byte[] bytes = System.Text.Encoding.Unicode.GetBytes(charArray);
this.textBox2.Text = System.Text.Encoding.Unicode.GetString(bytes);
Array.Sort(charArray);
bytes=System.Text.Encoding.Unicode.GetBytes(charArray);
this.textBox3.Text = System.Text.Encoding.Unicode.GetString(bytes);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -