Description

This is a simple calculator program that was written using Visual Studio.NET and C#. The calculator is a good program to learn how to use mouse and keyboard events. To use this code, create a new C# Windows Application project and paste this code in.

Source Code

  1. // Source Code starts
  2. using System;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. using System.Data;
  8. namespace Calculator1
  9. {
  10. /// <summary>
  11. /// This is a simple calculator program.
  12. /// Author: David Kulbok
  13. /// Date: 10/16/01
  14. /// Email: [email protected]
  15. ///
  16. /// This is my first venture into C# so some of the techniques might seem quick and dirty.
  17. /// If there is a more efficient way of doing something (i.e. Making sure that hitting Enter
  18. /// fires doEquals()) please let me know. I hope that you will learn as much from this
  19. /// program as I did about C# controls and events.
  20. ///
  21. /// David Kulbok
  22. ///
  23. /// </summary>
  24. public class Calculator1 : System.Windows.Forms.Form
  25. {
  26. #region Constructor
  27. public Calculator1()
  28. {
  29. //
  30. // Required for Windows Form Designer support
  31. //
  32. InitializeComponent();
  33. }
  34. #endregion
  35. #region Global Variables
  36. private System.Windows.Forms.Button btnAdd;
  37. public System.Windows.Forms.TextBox txtResult;
  38. private System.Windows.Forms.Button btn1;
  39. private System.Windows.Forms.Button btn2;
  40. private System.Windows.Forms.Button btn3;
  41. private System.Windows.Forms.Button btn4;
  42. private System.Windows.Forms.Button btn5;
  43. private System.Windows.Forms.Button btn6;
  44. private System.Windows.Forms.Button btn7;
  45. private System.Windows.Forms.Button btn8;
  46. private System.Windows.Forms.Button btn9;
  47. private System.Windows.Forms.Button btn0;
  48. private System.Windows.Forms.Button btnSubtract;
  49. private System.Windows.Forms.Button btnMultiply;
  50. private System.Windows.Forms.Button btnDivide;
  51. private System.Windows.Forms.Button btnEquals;
  52. private System.Windows.Forms.Button btnClear;
  53. private System.Windows.Forms.Button btnNegative;
  54. private System.Windows.Forms.Button btnDecimal;
  55. /// <summary>
  56. /// Required designer variable.
  57. /// </summary>
  58. private System.ComponentModel.Container components = null;
  59. /// <summary>
  60. /// These are global variables defined for use in the calculator
  61. /// <summary>
  62. private int opMain = 0; /// Stores the value of the operation (1-4)
  63. private double mainNum1 = 0; ///Stores the value of the first number
  64. private double mainNum2 = 0; ///Stores the value of the second number
  65. private bool isSecond = false; //Boolean value used to determine if input is the second or first number.
  66. private bool isDone = false; ///Boolean value used to determine if the equals key was pressed.
  67. private bool isDecimal = false; //Boolean value used to determine if there is a decimal in the number.
  68. #endregion
  69. #region Dispose
  70. /// <summary>
  71. /// Clean up any resources being used.
  72. /// </summary>
  73. protected override void Dispose(bool disposing)
  74. {
  75. if (disposing)
  76. {
  77. if (components != null)
  78. {
  79. components.Dispose();
  80. }
  81. }
  82. base.Dispose(disposing);
  83. }
  84. #endregion
  85. #region Windows Form Designer generated code
  86. /// <summary>
  87. /// Required method for Designer support - do not modify
  88. /// the contents of this method with the code editor.
  89. /// Most of these just set the controls and the properties for them. There are some event handlers that I will explain as I go along.
  90. /// <summary>
  91. private void InitializeComponent()
  92. {
  93. this.btn2 = new System.Windows.Forms.Button();
  94. this.btn3 = new System.Windows.Forms.Button();
  95. this.btn0 = new System.Windows.Forms.Button();
  96. this.btn1 = new System.Windows.Forms.Button();
  97. this.btn6 = new System.Windows.Forms.Button();
  98. this.btn7 = new System.Windows.Forms.Button();
  99. this.btn4 = new System.Windows.Forms.Button();
  100. this.btnDivide = new System.Windows.Forms.Button();
  101. this.btn9 = new System.Windows.Forms.Button();
  102. this.btnAdd = new System.Windows.Forms.Button();
  103. this.btnSubtract = new System.Windows.Forms.Button();
  104. this.btnDecimal = new System.Windows.Forms.Button();
  105. this.btnClear = new System.Windows.Forms.Button();
  106. this.txtResult = new System.Windows.Forms.TextBox();
  107. this.btnMultiply = new System.Windows.Forms.Button();
  108. this.btn5 = new System.Windows.Forms.Button();
  109. this.btn8 = new System.Windows.Forms.Button();
  110. this.btnEquals = new System.Windows.Forms.Button();
  111. this.btnNegative = new System.Windows.Forms.Button();
  112. this.SuspendLayout();
  113. //
  114. // btn2
  115. //
  116. this.btn2.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  117. this.btn2.Location = new System.Drawing.Point(48, 40);
  118. this.btn2.Name = "btn2";
  119. this.btn2.Size = new System.Drawing.Size(32, 32);
  120. this.btn2.TabIndex = 13;
  121. this.btn2.TabStop = false;
  122. this.btn2.Text = "2";
  123. this.btn2.Click += new System.EventHandler(this.btn2_Click);
  124. //
  125. // btn3
  126. //
  127. this.btn3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  128. this.btn3.Location = new System.Drawing.Point(88, 40);
  129. this.btn3.Name = "btn3";
  130. this.btn3.Size = new System.Drawing.Size(32, 32);
  131. this.btn3.TabIndex = 12;
  132. this.btn3.TabStop = false;
  133. this.btn3.Text = "3";
  134. this.btn3.Click += new System.EventHandler(this.btn3_Click);
  135. //
  136. // btn0
  137. //
  138. this.btn0.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  139. this.btn0.Location = new System.Drawing.Point(48, 160);
  140. this.btn0.Name = "btn0";
  141. this.btn0.Size = new System.Drawing.Size(32, 32);
  142. this.btn0.TabIndex = 5;
  143. this.btn0.TabStop = false;
  144. this.btn0.Text = "0";
  145. this.btn0.Click += new System.EventHandler(this.btn0_Click);
  146. //
  147. // btn1
  148. //
  149. this.btn1.ForeColor = ystem.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  150. this.btn1.Location = new System.Drawing.Point(8, 40);
  151. this.btn1.Name = "btn1";
  152. this.btn1.Size = new System.Drawing.Size(32, 32);
  153. this.btn1.TabIndex = 14;
  154. this.btn1.TabStop = false;
  155. this.btn1.Text = "1";
  156. this.btn1.Click += new System.EventHandler(this.btn1_Click_1);
  157. //
  158. // btn6
  159. //
  160. this.btn6.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  161. this.btn6.Location = new System.Drawing.Point(88, 80);
  162. this.btn6.Name = "btn6";
  163. this.btn6.Size = new System.Drawing.Size(32, 32);
  164. this.btn6.TabIndex = 9;
  165. this.btn6.TabStop = false;
  166. this.btn6.Text = "6";
  167. this.btn6.Click += new System.EventHandler(this.btn6_Click);
  168. //
  169. //btn7
  170. //
  171. this.btn7.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  172. this.btn7.Location = new System.Drawing.Point(8, 120);
  173. this.btn7.Name = "btn7";
  174. this.btn7.Size = new System.Drawing.Size(32, 32);
  175. this.btn7.TabIndex = 8;
  176. this.btn7.TabStop = false;
  177. this.btn7.Text = "7";
  178. this.btn7.Click += new System.EventHandler(this.btn7_Click);
  179. //
  180. // btn4
  181. //
  182. this.btn4.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  183. this.btn4.Location = new System.Drawing.Point(8, 80);
  184. this.btn4.Name = "btn4";
  185. this.btn4.Size = new System.Drawing.Size(32, 32);
  186. this.btn4.TabIndex = 11;
  187. this.btn4.TabStop = false;
  188. this.btn4.Text = "4";
  189. this.btn4.Click += new System.EventHandler(this.btn4_Click);
  190. //
  191. // btnDivide
  192. //
  193. this.btnDivide.Location = new System.Drawing.Point(136, 160);
  194. this.btnDivide.Name = "btnDivide";
  195. this.btnDivide.Size = new System.Drawing.Size(32, 32);
  196. this.btnDivide.TabIndex = 2;
  197. this.btnDivide.TabStop = false;
  198. this.btnDivide.Text = "/";
  199. this.btnDivide.Click += new System.EventHandler(this.btnDivide_Click);
  200. //
  201. // btn9
  202. //
  203. this.btn9.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
  204. this.btn9.Location = new System.Drawing.Point(88, 120);
  205. this.btn9.Name = "btn9";
  206. this.btn9.Size = new System.Drawing.Size(32, 32);
  207. this.btn9.TabIndex = 6;
  208. this.btn9.TabStop = false;
  209. this.btn9.Text = "9";
  210. this.btn9.Click += new System.EventHandler(this.btn9_Click);
  211. //
  212. // btnAdd
  213. //
  214. this.btnAdd.Location = new System.Drawing.Point(136, 40);
  215. this.btnAdd.Name = "btnAdd";
  216. this.btnAdd.Size = new System.Drawing.Size(32, 32);
  217. this.btnAdd.TabIndex = 15;
  218. this.btnAdd.TabStop = false;
  219. this.btnAdd.Text = "+";
  220. this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
  221. //
  222. // btnSubtract
  223. //
  224. this.btnSubtract.Location = new System.Drawing.Point(136, 80);
  225. this.btnSubtract.Name = "btnSubtract";
  226. this.btnSubtract.Size = new System.Drawing.Size(32, 32);
  227. this.btnSubtract.TabIndex = 4;
  228. this.btnSubtract.TabStop = false;
  229. this.btnSubtract.Text = "-";
  230. this.btnSubtract.Click += new System.EventHandler(this.btnSubtract_Click);
  231. //
  232. // btnDecimal
  233. //
  234. this.btnDecimal.Location = new System.Drawing.Point(88, 200);
  235. this.btnDecimal.Name = "btnDecimal";
  236. this.btnDecimal.Size = new System.Drawing.Size(32, 32);
  237. this.btnDecimal.TabIndex = 17;
  238. this.btnDecimal.TabStop = false;
  239. this.btnDecimal.Text = ".";
  240. this.btnDecimal.Click += new System.EventHandler(this.btnDecimal_Click);
  241. //
  242. // btnClear
  243. //
  244. this.btnClear.ForeColor = System.Drawing.Color.Red;
  245. this.btnClear.Location = new System.Drawing.Point(8, 200);
  246. this.btnClear.Name = "btnClear";
  247. this.btnClear.Size = new System.Drawing.Size(32, 32);
  248. this.btnClear.TabIndex = 0;
  249. this.btnClear.TabStop = false;
  250. this.btnClear.Text = "C";
  251. this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
  252. //
  253. // txtResult
  254. //
  255. this.txtResult.Location = new System.Drawing.Point(8, 8);
  256. this.txtResult.Name = "txtResult";
  257. this.txtResult.RightToLeft = System.Windows.Forms.RightToLeft.No;
  258. this.txtResult.Size = new System.Drawing.Size(160, 20);
  259. this.txtResult.TabIndex = 15;
  260. this.txtResult.TabStop = false;
  261. this.txtResult.Text = "";
  262. this.txtResult.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
  263. //
  264. // btnMultiply
  265. //
  266. this.btnMultiply.Location = new System.Drawing.Point(136, 120);
  267. this.btnMultiply.Name = "btnMultiply";
  268. this.btnMultiply.Size = new System.Drawing.Size(32, 32);
  269. this.btnMultiply.TabIndex = 3;
  270. this.btnMultiply.TabStop = false;
  271. this.btnMultiply.Text = "*";
  272. this.btnMultiply.Click += new System.EventHandler(this.btnMultiply_Click);
  273. //
  274. // btn5
  275. //
  276. this.btn5.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)192)));
  277. this.btn5.Location = new System.Drawing.Point(48, 80);
  278. this.btn5.Name = "btn5";
  279. this.btn5.Size = new System.Drawing.Size(32, 32);
  280. this.btn5.TabIndex = 10;
  281. this.btn5.TabStop = false;
  282. this.btn5.Text = "5";
  283. this.btn5.Click += new System.EventHandler(this.btn5_Click);
  284. //
  285. // btn8
  286. //this.btn8.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)),((System.Byte)(0)),((System.Byte)(192)));
  287. this.btn8.Location = new System.Drawing.Point(48, 120);
  288. this.btn8.Name = "btn8";
  289. this.btn8.Size = new System.Drawing.Size(32, 32);
  290. this.btn8.TabIndex = 7;
  291. this.btn8.TabStop = false;
  292. this.btn8.Text = "8";
  293. this.btn8.Click += new System.EventHandler(this.btn8_Click);
  294. //
  295. // btnEquals
  296. //
  297. this.btnEquals.Location = new System.Drawing.Point(136, 200);
  298. this.btnEquals.Name = "btnEquals";
  299. this.btnEquals.Size = new System.Drawing.Size(32, 32);
  300. this.btnEquals.TabIndex = 1;
  301. this.btnEquals.TabStop = false;
  302. this.btnEquals.Text = "=";
  303. this.btnEquals.Click += new System.EventHandler(this.btnEquals_Click);
  304. //
  305. // btnNegative
  306. //
  307. this.btnNegative.Location = new System.Drawing.Point(48, 200);
  308. this.btnNegative.Name = "btnNegative";
  309. this.btnNegative.Size = new System.Drawing.Size(32, 32);
  310. this.btnNegative.TabIndex = 16;
  311. this.btnNegative.TabStop = false;
  312. this.btnNegative.Text = "+/-";
  313. this.btnNegative.Click += new System.EventHandler(this.btnNegative_Click);
  314. //
  315. // Calculator1
  316. //
  317. this.AcceptButton = this.btnEquals;
  318. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  319. this.ClientSize = new System.Drawing.Size(176, 245);
  320. this.Controls.AddRange(new System.Windows.Forms.Control[]
  321. {this.btnDecimal,
  322. this.btnNegative,
  323. this.btnClear,
  324. this.btnEquals,
  325. this.btnDivide,
  326. this.btnMultiply,
  327. this.btnSubtract,
  328. this.btn0,
  329. this.btn9,
  330. this.btn8,
  331. this.btn7,
  332. this.btn6,
  333. this.btn5,
  334. this.btn4,
  335. this.btn3,
  336. this.btn2,
  337. this.btn1,
  338. this.txtResult,
  339. this.btnAdd});
  340. this.KeyPreview = true;
  341. this.Name = "Calculator1";
  342. this.Text = "Calculator";
  343. this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Btn_KeyDown);
  344. this.ResumeLayout(false);
  345. }
  346. #endregion
  347. ///Custom Methods
  348. #region setText(String textset)
  349. /// <summary>
  350. /// This method is used to set the text in the textbox to the number entered by the user.
  351. /// <summary>
  352. /// <param name="textset"></param>
  353. public void setText(String textset)
  354. {
  355. if (textset.Equals("clear"))
  356. //If the user hits the clear button
  357. txtResult.Text = ""; //Clear the text and reset the boolean variables.
  358. isDone = false;
  359. isSecond = false;
  360. isDecimal = false;
  361. }
  362. else
  363. {
  364. if(isSecond) //Determine if the number being entered is the begining of the second number.If it is:
  365. {
  366. txtResult.Text = textset;
  367. //Start the text over and set the first # to what the user enters
  368. isSecond = false; //So Calculator knows to continue the # rather than making a new one.
  369. isDecimal = false;
  370. }
  371. else
  372. {
  373. if(isDone) //isDone lets the program know that the user just hit "=" and if they press another # to start a new number.
  374. {
  375. txtResult.Text = textset;
  376. isDone=false; //Set isDone to false so that the number just started is added on to and a new # is not started.
  377. }
  378. else
  379. txtResult.Text += textset; //Simply add on to the existing #.
  380. }
  381. }
  382. btnEquals.Select();
  383. //Set the focus back to the "=" button.
  384. }
  385. #endregion
  386. #region Calc(double num1, double num2, int op)
  387. /// <summary>
  388. /// Calc takes the 2 numbers and the operation and calcualtes the answer.
  389. /// <summary>
  390. /// <param name="num1"></param>
  391. /// <param name="num2"></param>
  392. /// <param name="op"></param>
  393. public void Calc(double num1, double num2, int op)
  394. {
  395. double answer = 0;//Initialize answer to 0;
  396. switch (op) //Determine which operation to perform depending on the value of "op"
  397. {
  398. case1:| answer = num1 + num2;
  399. break;
  400. case 2:
  401. answer = num1 - num2;
  402. break;
  403. case 3:
  404. answer = num1 * num2;
  405. break;
  406. case 4:
  407. answer = num1 / num2;
  408. break;
  409. }
  410. setText(answer.ToString()); //Show the answer in the textbox;
  411. }
  412. #endregion
  413. #region doEquals()
  414. /// <summary>
  415. /// This method stores the second number, clears the textbox and calls the Calc method
  416. /// </summary>
  417. private void doEquals()
  418. {
  419. mainNum2 = double.Parse(txtResult.Text);
  420. //Set the value of the second number
  421. setText("clear"); //Clear the textbox
  422. Calc(mainNum1, mainNum2, opMain); //Call the Calc method
  423. isDone = true; //Set isDone to true so that if another # is pressed, the program will begin a new number
  424. }
  425. #endregion
  426. #region changeSign()
  427. /// <summary>
  428. /// This method changes the sign of the number. If the number is positive
  429. /// it makes it negative and vice versa.
  430. /// </summary>
  431. private void changeSign()
  432. {
  433. double storNum; //Variable to store value of number
  434. if (txtResult.Text.Length > 0) //If there is a number...
  435. {
  436. storNum = double.Parse(txtResult.Text); //Store its value
  437. storNum *= -1; //multiply by negative 1
  438. txtResult.Text = storNum.ToString(); //put it in the textbox.
  439. }
  440. btnEquals.Select(); //Set focus to "=" button
  441. }
  442. #endregion
  443. #region setOperator(int operation)
  444. /// <summary>
  445. /// The method is used to store the first number and the operation being performed.
  446. /// <summary>
  447. // <param name="operation"></param>
  448. private void setOperator(int operation)
  449. {
  450. if (txtResult.Text.Length > 0)//Make sure that the user entered a number
  451. {
  452. opMain = operation; //Store the operation
  453. mainNum1 = double.Parse(txtResult.Text); //Store the value of the first number
  454. isSecond = true; //Let the program know to begin the second number
  455. isDone = false; //If a operator button is pressed before a new number, let the program know to start a new umber.
  456. btnEquals.Select(); //Set the focus to the equals button.
  457. }
  458. }
  459. #endregion
  460. #region setDecimal()
  461. /// <summary>
  462. /// This method checks to see if the # has a decimal in it. If not, it
  463. /// puts one in. If it does, no decimal is entered.
  464. /// </summary>
  465. private void setDecimal()
  466. {
  467. if (!isDecimal)//Check for existing decimal
  468. {
  469. setText("."); //Add decimal
  470. isDecimal = true; //Let program know decimal has been added
  471. }
  472. btnEquals.Select(); //Set focus to "=" button
  473. }
  474. #endregion
  475. #region KeyBoard Events
  476. /// <summary>
  477. /// This method simply determines which key is being pressed.
  478. /// </summary>
  479. /// <param name="sender"></param>
  480. /// <param name="e"></param>
  481. protected void Btn_KeyDown(object sender, KeyEventArgs e)
  482. {
  483. //MessageBox.Show(e.KeyValue.ToString());
  484. filterKeys(e.KeyValue);
  485. }
  486. /// <summary>
  487. /// This method accepts the value of the key and calls the corresponding methods.
  488. /// It is pretty self-explanatory.
  489. /// </summary>
  490. /// <param name="keyCode"></param>
  491. public void filterKeys(int keyCode)
  492. {
  493. switch (keyCode)
  494. {
  495. case 96:
  496. setText("0");
  497. break;
  498. case 97:
  499. setText("1");
  500. break;
  501. case 98:
  502. setText("2");
  503. break;
  504. case 99:
  505. setText("3");
  506. break;
  507. case 100:
  508. setText("4");
  509. break;
  510. case 101:
  511. setText("5");
  512. break;
  513. case 102:
  514. setText("6");
  515. break;
  516. case 103:
  517. setText("7");
  518. break;
  519. case 104:
  520. setText("8");
  521. break;
  522. case 105:
  523. setText("9");
  524. break;
  525. case 67:
  526. setText("clear");
  527. break;
  528. case 107:
  529. setOperator(1);
  530. break;
  531. case 109:
  532. setOperator(2);
  533. break;
  534. case 106:
  535. setOperator(3);
  536. break;
  537. case 111:
  538. setOperator(4);
  539. break;
  540. case 110:
  541. setDecimal();
  542. break;
  543. }
  544. }
  545. #endregion
  546. #region Button Functions
  547. ///These methods do the same as when a key is pressed except the respond to the
  548. ///mouse clicks on the different controls. These are the methods that were mapped to
  549. ///the controls up top.
  550. private void btnAdd_Click(object sender, System.EventArgs e)
  551. {
  552. setOperator(1);
  553. }
  554. private void btn1_Click_1(object sender, System.EventArgs e)
  555. {
  556. setText("1");
  557. }
  558. private void btn2_Click(object sender, System.EventArgs e)
  559. {
  560. setText("2");
  561. }
  562. private void btn3_Click(object sender, System.EventArgs e)
  563. {
  564. setText("3");
  565. }
  566. private void btn4_Click(object sender, System.EventArgs e)
  567. {
  568. setText("4");
  569. }
  570. private void btn5_Click(object sender, System.EventArgs e)
  571. {
  572. setText("5");
  573. }
  574. private void btn6_Click(object sender, System.EventArgs e)
  575. {
  576. setText("6");
  577. }
  578. private void btn7_Click(object sender, System.EventArgs e)
  579. {
  580. setText("7");
  581. }
  582. private void btn8_Click(object sender, System.EventArgs e)
  583. {
  584. setText("8");
  585. }
  586. private void btn9_Click(object sender, System.EventArgs e)
  587. {
  588. setText("9");
  589. }
  590. private void btn0_Click(object sender, System.EventArgs e)
  591. {
  592. setText("0");
  593. }
  594. private void btnEquals_Click(object sender, System.EventArgs e)
  595. {
  596. doEquals();
  597. }
  598. private void btnClear_Click(object sender, System.EventArgs e)
  599. {
  600. isSecond = false;
  601. setText("clear");
  602. }
  603. private void btnSubtract_Click(object sender, System.EventArgs e)
  604. {
  605. setOperator(2);
  606. }
  607. private void btnMultiply_Click(object sender, System.EventArgs e)
  608. {
  609. setOperator(3);
  610. }
  611. private void btnDivide_Click(object sender, System.EventArgs e)
  612. {
  613. setOperator(4);
  614. }
  615. private void btnNegative_Click(object sender, System.EventArgs e)
  616. {
  617. changeSign();
  618. }
  619. private void btnDecimal_Click(object sender, System.EventArgs e)
  620. {
  621. setDecimal();
  622. }
  623. #endregion
  624. #region Main()
  625. /// <summary>
  626. /// The main entry point for the application.
  627. /// </summary>
  628. [STAThread]
  629. static void Main()
  630. deApplication.Run(new Calculator1());
  631. }
  632. #endregion
  633. }
  634. }
  635. // Source Code End