frmNumberWriter.cs.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using Infragistics.Win.UltraWinMaskedEdit;
  7. namespace Core.LgMes.Client.LgIntegrationQuery
  8. {
  9. /// <summary>
  10. /// FrmNumberWriter 的摘要说明。
  11. /// </summary>
  12. public class frmNumberWriter : System.Windows.Forms.Form
  13. {
  14. private System.Windows.Forms.Button button1;
  15. private System.Windows.Forms.Button button2;
  16. private System.Windows.Forms.Button button3;
  17. private System.Windows.Forms.Button button4;
  18. private System.Windows.Forms.Button button5;
  19. private System.Windows.Forms.Button button6;
  20. private System.Windows.Forms.Button button7;
  21. private System.Windows.Forms.Button button8;
  22. private System.Windows.Forms.Button button9;
  23. private System.Windows.Forms.Button button10;
  24. private System.Windows.Forms.Button button11;
  25. private System.Windows.Forms.Button button12;
  26. private System.Windows.Forms.Button button13;
  27. private System.Windows.Forms.TextBox ultraMaskedEdit1;
  28. private System.Windows.Forms.Button button14;
  29. private Button button15;
  30. private Button button16;
  31. /// <summary>
  32. /// 必需的设计器变量。
  33. /// </summary>
  34. private System.ComponentModel.Container components = null;
  35. public frmNumberWriter()
  36. {
  37. //
  38. // Windows 窗体设计器支持所必需的
  39. //
  40. InitializeComponent();
  41. //
  42. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  43. //
  44. }
  45. /// <summary>
  46. /// 清理所有正在使用的资源。
  47. /// </summary>
  48. protected override void Dispose( bool disposing )
  49. {
  50. if( disposing )
  51. {
  52. if(components != null)
  53. {
  54. components.Dispose();
  55. }
  56. }
  57. base.Dispose( disposing );
  58. }
  59. #region Windows 窗体设计器生成的代码
  60. /// <summary>
  61. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  62. /// 此方法的内容。
  63. /// </summary>
  64. private void InitializeComponent()
  65. {
  66. this.button1 = new System.Windows.Forms.Button();
  67. this.button2 = new System.Windows.Forms.Button();
  68. this.button3 = new System.Windows.Forms.Button();
  69. this.button4 = new System.Windows.Forms.Button();
  70. this.button5 = new System.Windows.Forms.Button();
  71. this.button6 = new System.Windows.Forms.Button();
  72. this.button7 = new System.Windows.Forms.Button();
  73. this.button8 = new System.Windows.Forms.Button();
  74. this.button9 = new System.Windows.Forms.Button();
  75. this.button10 = new System.Windows.Forms.Button();
  76. this.button11 = new System.Windows.Forms.Button();
  77. this.button12 = new System.Windows.Forms.Button();
  78. this.button13 = new System.Windows.Forms.Button();
  79. this.ultraMaskedEdit1 = new System.Windows.Forms.TextBox();
  80. this.button14 = new System.Windows.Forms.Button();
  81. this.button15 = new System.Windows.Forms.Button();
  82. this.button16 = new System.Windows.Forms.Button();
  83. this.SuspendLayout();
  84. //
  85. // button1
  86. //
  87. this.button1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  88. this.button1.ForeColor = System.Drawing.Color.Black;
  89. this.button1.Location = new System.Drawing.Point(8, 39);
  90. this.button1.Name = "button1";
  91. this.button1.Size = new System.Drawing.Size(48, 40);
  92. this.button1.TabIndex = 1;
  93. this.button1.Text = "1";
  94. this.button1.Click += new System.EventHandler(this.button_Click);
  95. //
  96. // button2
  97. //
  98. this.button2.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  99. this.button2.ForeColor = System.Drawing.Color.Black;
  100. this.button2.Location = new System.Drawing.Point(72, 39);
  101. this.button2.Name = "button2";
  102. this.button2.Size = new System.Drawing.Size(48, 40);
  103. this.button2.TabIndex = 2;
  104. this.button2.Text = "2";
  105. this.button2.Click += new System.EventHandler(this.button_Click);
  106. //
  107. // button3
  108. //
  109. this.button3.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  110. this.button3.ForeColor = System.Drawing.Color.Black;
  111. this.button3.Location = new System.Drawing.Point(136, 39);
  112. this.button3.Name = "button3";
  113. this.button3.Size = new System.Drawing.Size(48, 40);
  114. this.button3.TabIndex = 3;
  115. this.button3.Text = "3";
  116. this.button3.Click += new System.EventHandler(this.button_Click);
  117. //
  118. // button4
  119. //
  120. this.button4.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  121. this.button4.ForeColor = System.Drawing.Color.Black;
  122. this.button4.Location = new System.Drawing.Point(8, 87);
  123. this.button4.Name = "button4";
  124. this.button4.Size = new System.Drawing.Size(48, 40);
  125. this.button4.TabIndex = 4;
  126. this.button4.Text = "4";
  127. this.button4.Click += new System.EventHandler(this.button_Click);
  128. //
  129. // button5
  130. //
  131. this.button5.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  132. this.button5.ForeColor = System.Drawing.Color.Black;
  133. this.button5.Location = new System.Drawing.Point(72, 87);
  134. this.button5.Name = "button5";
  135. this.button5.Size = new System.Drawing.Size(48, 40);
  136. this.button5.TabIndex = 5;
  137. this.button5.Text = "5";
  138. this.button5.Click += new System.EventHandler(this.button_Click);
  139. //
  140. // button6
  141. //
  142. this.button6.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  143. this.button6.ForeColor = System.Drawing.Color.Black;
  144. this.button6.Location = new System.Drawing.Point(136, 87);
  145. this.button6.Name = "button6";
  146. this.button6.Size = new System.Drawing.Size(48, 40);
  147. this.button6.TabIndex = 6;
  148. this.button6.Text = "6";
  149. this.button6.Click += new System.EventHandler(this.button_Click);
  150. //
  151. // button7
  152. //
  153. this.button7.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  154. this.button7.ForeColor = System.Drawing.Color.Black;
  155. this.button7.Location = new System.Drawing.Point(8, 135);
  156. this.button7.Name = "button7";
  157. this.button7.Size = new System.Drawing.Size(48, 40);
  158. this.button7.TabIndex = 7;
  159. this.button7.Text = "7";
  160. this.button7.Click += new System.EventHandler(this.button_Click);
  161. //
  162. // button8
  163. //
  164. this.button8.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  165. this.button8.ForeColor = System.Drawing.Color.Black;
  166. this.button8.Location = new System.Drawing.Point(72, 135);
  167. this.button8.Name = "button8";
  168. this.button8.Size = new System.Drawing.Size(48, 40);
  169. this.button8.TabIndex = 8;
  170. this.button8.Text = "8";
  171. this.button8.Click += new System.EventHandler(this.button_Click);
  172. //
  173. // button9
  174. //
  175. this.button9.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  176. this.button9.ForeColor = System.Drawing.Color.Black;
  177. this.button9.Location = new System.Drawing.Point(136, 135);
  178. this.button9.Name = "button9";
  179. this.button9.Size = new System.Drawing.Size(48, 40);
  180. this.button9.TabIndex = 9;
  181. this.button9.Text = "9";
  182. this.button9.Click += new System.EventHandler(this.button_Click);
  183. //
  184. // button10
  185. //
  186. this.button10.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  187. this.button10.ForeColor = System.Drawing.Color.Black;
  188. this.button10.Location = new System.Drawing.Point(200, 39);
  189. this.button10.Name = "button10";
  190. this.button10.Size = new System.Drawing.Size(48, 40);
  191. this.button10.TabIndex = 10;
  192. this.button10.Text = "0";
  193. this.button10.Click += new System.EventHandler(this.button_Click);
  194. //
  195. // button11
  196. //
  197. this.button11.Location = new System.Drawing.Point(200, 182);
  198. this.button11.Name = "button11";
  199. this.button11.Size = new System.Drawing.Size(48, 40);
  200. this.button11.TabIndex = 0;
  201. this.button11.Text = "取消";
  202. this.button11.Click += new System.EventHandler(this.button11_Click);
  203. //
  204. // button12
  205. //
  206. this.button12.Location = new System.Drawing.Point(72, 181);
  207. this.button12.Name = "button12";
  208. this.button12.Size = new System.Drawing.Size(48, 40);
  209. this.button12.TabIndex = 11;
  210. this.button12.Text = "删除";
  211. this.button12.Click += new System.EventHandler(this.button12_Click);
  212. //
  213. // button13
  214. //
  215. this.button13.Location = new System.Drawing.Point(136, 181);
  216. this.button13.Name = "button13";
  217. this.button13.Size = new System.Drawing.Size(48, 40);
  218. this.button13.TabIndex = 13;
  219. this.button13.Text = "确定";
  220. this.button13.Click += new System.EventHandler(this.button13_Click);
  221. //
  222. // ultraMaskedEdit1
  223. //
  224. this.ultraMaskedEdit1.Location = new System.Drawing.Point(8, 7);
  225. this.ultraMaskedEdit1.Name = "ultraMaskedEdit1";
  226. this.ultraMaskedEdit1.Size = new System.Drawing.Size(238, 21);
  227. this.ultraMaskedEdit1.TabIndex = 14;
  228. //
  229. // button14
  230. //
  231. this.button14.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  232. this.button14.ForeColor = System.Drawing.Color.Black;
  233. this.button14.Location = new System.Drawing.Point(200, 87);
  234. this.button14.Name = "button14";
  235. this.button14.Size = new System.Drawing.Size(48, 40);
  236. this.button14.TabIndex = 15;
  237. this.button14.Text = "J";
  238. this.button14.Click += new System.EventHandler(this.button_Click);
  239. //
  240. // button15
  241. //
  242. this.button15.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  243. this.button15.ForeColor = System.Drawing.Color.Black;
  244. this.button15.Location = new System.Drawing.Point(200, 135);
  245. this.button15.Name = "button15";
  246. this.button15.Size = new System.Drawing.Size(48, 40);
  247. this.button15.TabIndex = 16;
  248. this.button15.Text = "-";
  249. this.button15.Click += new System.EventHandler(this.button_Click);
  250. //
  251. // button16
  252. //
  253. this.button16.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  254. this.button16.ForeColor = System.Drawing.Color.Black;
  255. this.button16.Location = new System.Drawing.Point(8, 181);
  256. this.button16.Name = "button16";
  257. this.button16.Size = new System.Drawing.Size(48, 40);
  258. this.button16.TabIndex = 17;
  259. this.button16.Text = "A";
  260. this.button16.Click += new System.EventHandler(this.button_Click);
  261. //
  262. // frmNumberWriter
  263. //
  264. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  265. this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(191)))), ((int)(((byte)(231)))));
  266. this.ClientSize = new System.Drawing.Size(258, 238);
  267. this.Controls.Add(this.button16);
  268. this.Controls.Add(this.button15);
  269. this.Controls.Add(this.button14);
  270. this.Controls.Add(this.ultraMaskedEdit1);
  271. this.Controls.Add(this.button13);
  272. this.Controls.Add(this.button12);
  273. this.Controls.Add(this.button11);
  274. this.Controls.Add(this.button10);
  275. this.Controls.Add(this.button9);
  276. this.Controls.Add(this.button8);
  277. this.Controls.Add(this.button7);
  278. this.Controls.Add(this.button6);
  279. this.Controls.Add(this.button5);
  280. this.Controls.Add(this.button4);
  281. this.Controls.Add(this.button3);
  282. this.Controls.Add(this.button2);
  283. this.Controls.Add(this.button1);
  284. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  285. this.MaximizeBox = false;
  286. this.MinimizeBox = false;
  287. this.Name = "frmNumberWriter";
  288. this.ShowInTaskbar = false;
  289. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  290. this.Text = "数字编辑器";
  291. this.Load += new System.EventHandler(this.frmNumberWriter_Load);
  292. this.ResumeLayout(false);
  293. this.PerformLayout();
  294. }
  295. #endregion
  296. public string _strText = "";
  297. private void button_Click(object sender, System.EventArgs e)
  298. {
  299. if (this.ultraMaskedEdit1.Text.Length > 10) return;
  300. Button bt = (Button)sender;
  301. this.ultraMaskedEdit1.SelectedText = bt.Text;
  302. this.ultraMaskedEdit1.Focus();
  303. this.ultraMaskedEdit1.SelectionLength = 0;
  304. }
  305. private void button11_Click(object sender, System.EventArgs e)
  306. {
  307. this.Close();
  308. }
  309. private void button12_Click(object sender, System.EventArgs e)
  310. {
  311. this.ultraMaskedEdit1.SelectedText = "";
  312. this.ultraMaskedEdit1.Focus();
  313. }
  314. private void frmNumberWriter_Load(object sender, System.EventArgs e)
  315. {
  316. this.ultraMaskedEdit1.ReadOnly = true;
  317. this.ultraMaskedEdit1.Text = _strText;
  318. this.ultraMaskedEdit1.Focus();
  319. this.ultraMaskedEdit1.SelectionStart = _strText.Length;
  320. this.ultraMaskedEdit1.SelectionLength = 0;
  321. }
  322. private void button13_Click(object sender, System.EventArgs e)
  323. {
  324. _strText = this.ultraMaskedEdit1.Text;
  325. this.Close();
  326. }
  327. }
  328. }