Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Equation Solver - Form5.cs

Form5.cs

Caricato da: Matthew
Scarica il programma completo

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8.  
  9. namespace Equazioni_2
  10. {
  11.     public partial class Form5 : Form
  12.     {
  13.         public Form5()
  14.         {
  15.             InitializeComponent();
  16.             label3.Text = Form1.cont1.ToString();
  17.  
  18.         }
  19.  
  20.         private void bt_coeff_Click(object sender, EventArgs e)
  21.         {
  22.             Ok();
  23.         }
  24.  
  25.         private void Ok()
  26.         {
  27.             try
  28.             {
  29.                 Form1.coefficiente[Form1.cont1].Real = double.Parse(textBox2.Text);
  30.                 textBox2.Text = "";
  31.                 Form1.cont1--;
  32.                 if (Form1.cont1 != -1)
  33.                 {
  34.                     label3.Text = Form1.cont1.ToString();
  35.                     if (Form1.cont1 == 0)
  36.                     {
  37.                         label3.Text = "";
  38.                         label1.Text = "Termine noto: ";
  39.                     }
  40.                 }
  41.                 else
  42.                 {
  43.                     this.Close();
  44.                 }
  45.                 textBox2.Select();
  46.             }
  47.             catch
  48.             {
  49.                 MessageBox.Show("Inserire un valore numerico","Attenzione");
  50.             }
  51.         }
  52.  
  53.         private void textBox2_KeyDown(object sender, KeyEventArgs e)
  54.         {
  55.             switch (e.KeyData)
  56.             {
  57.                 case Keys.Enter:
  58.                     {
  59.                         Ok();
  60.                         textBox2.Select();
  61.                     }
  62.                     break;
  63.             }
  64.         }
  65.  
  66.     }
  67. }