| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using Infragistics.Win.UltraWinMaskedEdit;
- namespace Core.LgMes.Client.LgIntegrationQuery
- {
- /// <summary>
- /// FrmNumberWriter 的摘要说明。
- /// </summary>
- public class frmNumberWriter : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button5;
- private System.Windows.Forms.Button button6;
- private System.Windows.Forms.Button button7;
- private System.Windows.Forms.Button button8;
- private System.Windows.Forms.Button button9;
- private System.Windows.Forms.Button button10;
- private System.Windows.Forms.Button button11;
- private System.Windows.Forms.Button button12;
- private System.Windows.Forms.Button button13;
- private System.Windows.Forms.TextBox ultraMaskedEdit1;
- private System.Windows.Forms.Button button14;
- private Button button15;
- private Button button16;
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.Container components = null;
- public frmNumberWriter()
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- InitializeComponent();
- //
- // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
- //
- }
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows 窗体设计器生成的代码
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button8 = new System.Windows.Forms.Button();
- this.button9 = new System.Windows.Forms.Button();
- this.button10 = new System.Windows.Forms.Button();
- this.button11 = new System.Windows.Forms.Button();
- this.button12 = new System.Windows.Forms.Button();
- this.button13 = new System.Windows.Forms.Button();
- this.ultraMaskedEdit1 = new System.Windows.Forms.TextBox();
- this.button14 = new System.Windows.Forms.Button();
- this.button15 = new System.Windows.Forms.Button();
- this.button16 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // button1
- //
- this.button1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button1.ForeColor = System.Drawing.Color.Black;
- this.button1.Location = new System.Drawing.Point(8, 39);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(48, 40);
- this.button1.TabIndex = 1;
- this.button1.Text = "1";
- this.button1.Click += new System.EventHandler(this.button_Click);
- //
- // button2
- //
- this.button2.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button2.ForeColor = System.Drawing.Color.Black;
- this.button2.Location = new System.Drawing.Point(72, 39);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(48, 40);
- this.button2.TabIndex = 2;
- this.button2.Text = "2";
- this.button2.Click += new System.EventHandler(this.button_Click);
- //
- // button3
- //
- this.button3.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button3.ForeColor = System.Drawing.Color.Black;
- this.button3.Location = new System.Drawing.Point(136, 39);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(48, 40);
- this.button3.TabIndex = 3;
- this.button3.Text = "3";
- this.button3.Click += new System.EventHandler(this.button_Click);
- //
- // button4
- //
- this.button4.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button4.ForeColor = System.Drawing.Color.Black;
- this.button4.Location = new System.Drawing.Point(8, 87);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(48, 40);
- this.button4.TabIndex = 4;
- this.button4.Text = "4";
- this.button4.Click += new System.EventHandler(this.button_Click);
- //
- // button5
- //
- this.button5.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button5.ForeColor = System.Drawing.Color.Black;
- this.button5.Location = new System.Drawing.Point(72, 87);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(48, 40);
- this.button5.TabIndex = 5;
- this.button5.Text = "5";
- this.button5.Click += new System.EventHandler(this.button_Click);
- //
- // button6
- //
- this.button6.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button6.ForeColor = System.Drawing.Color.Black;
- this.button6.Location = new System.Drawing.Point(136, 87);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(48, 40);
- this.button6.TabIndex = 6;
- this.button6.Text = "6";
- this.button6.Click += new System.EventHandler(this.button_Click);
- //
- // button7
- //
- this.button7.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button7.ForeColor = System.Drawing.Color.Black;
- this.button7.Location = new System.Drawing.Point(8, 135);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(48, 40);
- this.button7.TabIndex = 7;
- this.button7.Text = "7";
- this.button7.Click += new System.EventHandler(this.button_Click);
- //
- // button8
- //
- this.button8.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button8.ForeColor = System.Drawing.Color.Black;
- this.button8.Location = new System.Drawing.Point(72, 135);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(48, 40);
- this.button8.TabIndex = 8;
- this.button8.Text = "8";
- this.button8.Click += new System.EventHandler(this.button_Click);
- //
- // button9
- //
- this.button9.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button9.ForeColor = System.Drawing.Color.Black;
- this.button9.Location = new System.Drawing.Point(136, 135);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(48, 40);
- this.button9.TabIndex = 9;
- this.button9.Text = "9";
- this.button9.Click += new System.EventHandler(this.button_Click);
- //
- // button10
- //
- this.button10.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button10.ForeColor = System.Drawing.Color.Black;
- this.button10.Location = new System.Drawing.Point(200, 39);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(48, 40);
- this.button10.TabIndex = 10;
- this.button10.Text = "0";
- this.button10.Click += new System.EventHandler(this.button_Click);
- //
- // button11
- //
- this.button11.Location = new System.Drawing.Point(200, 182);
- this.button11.Name = "button11";
- this.button11.Size = new System.Drawing.Size(48, 40);
- this.button11.TabIndex = 0;
- this.button11.Text = "取消";
- this.button11.Click += new System.EventHandler(this.button11_Click);
- //
- // button12
- //
- this.button12.Location = new System.Drawing.Point(72, 181);
- this.button12.Name = "button12";
- this.button12.Size = new System.Drawing.Size(48, 40);
- this.button12.TabIndex = 11;
- this.button12.Text = "删除";
- this.button12.Click += new System.EventHandler(this.button12_Click);
- //
- // button13
- //
- this.button13.Location = new System.Drawing.Point(136, 181);
- this.button13.Name = "button13";
- this.button13.Size = new System.Drawing.Size(48, 40);
- this.button13.TabIndex = 13;
- this.button13.Text = "确定";
- this.button13.Click += new System.EventHandler(this.button13_Click);
- //
- // ultraMaskedEdit1
- //
- this.ultraMaskedEdit1.Location = new System.Drawing.Point(8, 7);
- this.ultraMaskedEdit1.Name = "ultraMaskedEdit1";
- this.ultraMaskedEdit1.Size = new System.Drawing.Size(238, 21);
- this.ultraMaskedEdit1.TabIndex = 14;
- //
- // button14
- //
- this.button14.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button14.ForeColor = System.Drawing.Color.Black;
- this.button14.Location = new System.Drawing.Point(200, 87);
- this.button14.Name = "button14";
- this.button14.Size = new System.Drawing.Size(48, 40);
- this.button14.TabIndex = 15;
- this.button14.Text = "J";
- this.button14.Click += new System.EventHandler(this.button_Click);
- //
- // button15
- //
- this.button15.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button15.ForeColor = System.Drawing.Color.Black;
- this.button15.Location = new System.Drawing.Point(200, 135);
- this.button15.Name = "button15";
- this.button15.Size = new System.Drawing.Size(48, 40);
- this.button15.TabIndex = 16;
- this.button15.Text = "-";
- this.button15.Click += new System.EventHandler(this.button_Click);
- //
- // button16
- //
- this.button16.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.button16.ForeColor = System.Drawing.Color.Black;
- this.button16.Location = new System.Drawing.Point(8, 181);
- this.button16.Name = "button16";
- this.button16.Size = new System.Drawing.Size(48, 40);
- this.button16.TabIndex = 17;
- this.button16.Text = "A";
- this.button16.Click += new System.EventHandler(this.button_Click);
- //
- // frmNumberWriter
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(191)))), ((int)(((byte)(231)))));
- this.ClientSize = new System.Drawing.Size(258, 238);
- this.Controls.Add(this.button16);
- this.Controls.Add(this.button15);
- this.Controls.Add(this.button14);
- this.Controls.Add(this.ultraMaskedEdit1);
- this.Controls.Add(this.button13);
- this.Controls.Add(this.button12);
- this.Controls.Add(this.button11);
- this.Controls.Add(this.button10);
- this.Controls.Add(this.button9);
- this.Controls.Add(this.button8);
- this.Controls.Add(this.button7);
- this.Controls.Add(this.button6);
- this.Controls.Add(this.button5);
- this.Controls.Add(this.button4);
- this.Controls.Add(this.button3);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.button1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "frmNumberWriter";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- this.Text = "数字编辑器";
- this.Load += new System.EventHandler(this.frmNumberWriter_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- public string _strText = "";
- private void button_Click(object sender, System.EventArgs e)
- {
- if (this.ultraMaskedEdit1.Text.Length > 10) return;
- Button bt = (Button)sender;
- this.ultraMaskedEdit1.SelectedText = bt.Text;
- this.ultraMaskedEdit1.Focus();
- this.ultraMaskedEdit1.SelectionLength = 0;
- }
-
- private void button11_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
- private void button12_Click(object sender, System.EventArgs e)
- {
- this.ultraMaskedEdit1.SelectedText = "";
- this.ultraMaskedEdit1.Focus();
- }
- private void frmNumberWriter_Load(object sender, System.EventArgs e)
- {
- this.ultraMaskedEdit1.ReadOnly = true;
- this.ultraMaskedEdit1.Text = _strText;
- this.ultraMaskedEdit1.Focus();
- this.ultraMaskedEdit1.SelectionStart = _strText.Length;
- this.ultraMaskedEdit1.SelectionLength = 0;
- }
- private void button13_Click(object sender, System.EventArgs e)
- {
- _strText = this.ultraMaskedEdit1.Text;
- this.Close();
- }
- }
- }
|