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
ZeroStage - Form1.h

Form1.h

Caricato da:
Scarica il programma completo

  1. #using <mscorlib.dll>
  2.  
  3. #include "threadExample.h"
  4.  using namespace System;
  5.  using namespace System::Threading;
  6.  
  7. #pragma once
  8.  
  9. namespace ProgettoStageReal
  10. {
  11.  
  12.        
  13.  
  14.         using namespace System;
  15.         using namespace System::ComponentModel;
  16.         using namespace System::Collections;
  17.         using namespace System::Windows::Forms;
  18.         using namespace System::Data;
  19.         using namespace System::Drawing;
  20.         using namespace System::Threading;
  21.         using namespace System::IO;
  22.  
  23.  
  24.         public ref class Form1 : public System::Windows::Forms::Form
  25.         {
  26.         public:
  27.                 ProgettoStageReal::ThreadExample^ tws;
  28.         private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
  29.         public:
  30.                 String^ tmp;
  31.                 Form1(void)
  32.                 {
  33.                         InitializeComponent();
  34.                        
  35.                 }
  36.        
  37.         protected:
  38.                 /// <summary>
  39.                 /// Liberare le risorse in uso.
  40.                 /// </summary>
  41.                 ~Form1()
  42.                 {
  43.                         if (components)
  44.                         {
  45.                                 delete components;
  46.                         }
  47.                 }
  48.         public:
  49.                          System::Windows::Forms::NotifyIcon^  ZeroStage;
  50.                          System::Windows::Forms::Label^  label1;
  51.         private: System::Windows::Forms::ToolStripMenuItem^  calcolaTempoTotaleToolStripMenuItem;
  52.         private: System::Windows::Forms::TextBox^  textBox2;
  53.         private: System::Windows::Forms::ToolStripMenuItem^  salvaToolStripMenuItem;
  54.         private: System::Windows::Forms::Button^  button3;
  55.         private: System::Windows::Forms::MenuStrip^  menuStrip1;
  56.         private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
  57.         private: System::Windows::Forms::Label^  label5;
  58.         private: System::Windows::Forms::Button^  button1;
  59.         private: System::Windows::Forms::Button^  button2;
  60.         private: System::Windows::Forms::TextBox^  textBox1;
  61.         private: System::Windows::Forms::Label^  label3;
  62.         public:
  63.                          System::Windows::Forms::Label^  label4;
  64.                          System::Windows::Forms::Label^  label2;
  65.        
  66.         protected:
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.         private: System::ComponentModel::IContainer^  components;
  75.  
  76.         protected:
  77.  
  78.         private:
  79.                 //Label *p;
  80.                 /// <summary>
  81.                 /// Variabile di progettazione necessaria.
  82.                 /// </summary>
  83.  
  84.  
  85. #pragma region Windows Form Designer generated code
  86.                 /// <summary>
  87.                 /// Metodo necessario per il supporto della finestra di progettazione. Non modificare
  88.                 /// il contenuto del metodo con l'editor di codice.
  89.                 /// </summary>
  90.                 void InitializeComponent(void)
  91.                 {
  92.                         this->components = (gcnew System::ComponentModel::Container());
  93.                         System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  94.                         this->ZeroStage = (gcnew System::Windows::Forms::NotifyIcon(this->components));
  95.                         this->label1 = (gcnew System::Windows::Forms::Label());
  96.                         this->label2 = (gcnew System::Windows::Forms::Label());
  97.                         this->label3 = (gcnew System::Windows::Forms::Label());
  98.                         this->label4 = (gcnew System::Windows::Forms::Label());
  99.                         this->textBox1 = (gcnew System::Windows::Forms::TextBox());
  100.                         this->label5 = (gcnew System::Windows::Forms::Label());
  101.                         this->button1 = (gcnew System::Windows::Forms::Button());
  102.                         this->button2 = (gcnew System::Windows::Forms::Button());
  103.                         this->button3 = (gcnew System::Windows::Forms::Button());
  104.                         this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
  105.                         this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  106.                         this->salvaToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  107.                         this->calcolaTempoTotaleToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  108.                         this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
  109.                         this->textBox2 = (gcnew System::Windows::Forms::TextBox());
  110.                         this->menuStrip1->SuspendLayout();
  111.                         this->SuspendLayout();
  112.                         //
  113.                         // ZeroStage
  114.                         //
  115.                         this->ZeroStage->BalloonTipIcon = System::Windows::Forms::ToolTipIcon::Info;
  116.                         this->ZeroStage->BalloonTipText = L"Programma x Stage";
  117.                         this->ZeroStage->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"ZeroStage.Icon")));
  118.                         this->ZeroStage->Text = L"ZeroStage";
  119.                         this->ZeroStage->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::notifyIcon1_MouseDoubleClick);
  120.                         //
  121.                         // label1
  122.                         //
  123.                         this->label1->AutoSize = true;
  124.                         this->label1->BackColor = System::Drawing::SystemColors::Desktop;
  125.                         this->label1->ForeColor = System::Drawing::SystemColors::Info;
  126.                         this->label1->Location = System::Drawing::Point(12, 33);
  127.                         this->label1->Name = L"label1";
  128.                         this->label1->Size = System::Drawing::Size(139, 13);
  129.                         this->label1->TabIndex = 0;
  130.                         this->label1->Text = L"ORA INIZIO PROGRAMMA";
  131.                         //
  132.                         // label2
  133.                         //
  134.                         this->label2->AutoSize = true;
  135.                         this->label2->BackColor = System::Drawing::SystemColors::Desktop;
  136.                         this->label2->ForeColor = System::Drawing::SystemColors::Info;
  137.                         this->label2->Location = System::Drawing::Point(235, 33);
  138.                         this->label2->Name = L"label2";
  139.                         this->label2->Size = System::Drawing::Size(16, 13);
  140.                         this->label2->TabIndex = 1;
  141.                         this->label2->Text = L"...";
  142.                         //
  143.                         // label3
  144.                         //
  145.                         this->label3->AutoSize = true;
  146.                         this->label3->BackColor = System::Drawing::SystemColors::Desktop;
  147.                         this->label3->ForeColor = System::Drawing::SystemColors::Info;
  148.                         this->label3->Location = System::Drawing::Point(12, 66);
  149.                         this->label3->Name = L"label3";
  150.                         this->label3->Size = System::Drawing::Size(133, 13);
  151.                         this->label3->TabIndex = 2;
  152.                         this->label3->Text = L"GIORNO / MESE / ANNO";
  153.                         //
  154.                         // label4
  155.                         //
  156.                         this->label4->AutoSize = true;
  157.                         this->label4->BackColor = System::Drawing::SystemColors::Desktop;
  158.                         this->label4->ForeColor = System::Drawing::SystemColors::Info;
  159.                         this->label4->Location = System::Drawing::Point(202, 66);
  160.                         this->label4->Name = L"label4";
  161.                         this->label4->Size = System::Drawing::Size(16, 13);
  162.                         this->label4->TabIndex = 3;
  163.                         this->label4->Text = L"...";
  164.                         //
  165.                         // textBox1
  166.                         //
  167.                         this->textBox1->BackColor = System::Drawing::SystemColors::Info;
  168.                         this->textBox1->Location = System::Drawing::Point(26, 117);
  169.                         this->textBox1->Multiline = true;
  170.                         this->textBox1->Name = L"textBox1";
  171.                         this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
  172.                         this->textBox1->Size = System::Drawing::Size(235, 105);
  173.                         this->textBox1->TabIndex = 4;
  174.                         //
  175.                         // label5
  176.                         //
  177.                         this->label5->AutoSize = true;
  178.                         this->label5->BackColor = System::Drawing::SystemColors::ControlText;
  179.                         this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 7.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  180.                                 static_cast<System::Byte>(0)));
  181.                         this->label5->ForeColor = System::Drawing::SystemColors::Info;
  182.                         this->label5->Location = System::Drawing::Point(93, 101);
  183.                         this->label5->Name = L"label5";
  184.                         this->label5->Size = System::Drawing::Size(98, 13);
  185.                         this->label5->TabIndex = 5;
  186.                         this->label5->Text = L"Risultato Raggiunto";
  187.                         //
  188.                         // button1
  189.                         //
  190.                         this->button1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"button1.BackgroundImage")));
  191.                         this->button1->Location = System::Drawing::Point(58, 239);
  192.                         this->button1->Name = L"button1";
  193.                         this->button1->Size = System::Drawing::Size(35, 35);
  194.                         this->button1->TabIndex = 6;
  195.                         this->button1->UseVisualStyleBackColor = true;
  196.                         this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  197.                         //
  198.                         // button2
  199.                         //
  200.                         this->button2->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"button2.BackgroundImage")));
  201.                         this->button2->Location = System::Drawing::Point(193, 239);
  202.                         this->button2->Name = L"button2";
  203.                         this->button2->Size = System::Drawing::Size(35, 35);
  204.                         this->button2->TabIndex = 7;
  205.                         this->button2->UseVisualStyleBackColor = true;
  206.                         this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
  207.                         //
  208.                         // button3
  209.                         //
  210.                         this->button3->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"button3.BackgroundImage")));
  211.                         this->button3->Location = System::Drawing::Point(126, 239);
  212.                         this->button3->Name = L"button3";
  213.                         this->button3->Size = System::Drawing::Size(35, 35);
  214.                         this->button3->TabIndex = 8;
  215.                         this->button3->UseVisualStyleBackColor = true;
  216.                         this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
  217.                         //
  218.                         // menuStrip1
  219.                         //
  220.                         this->menuStrip1->BackColor = System::Drawing::SystemColors::Highlight;
  221.                         this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->fileToolStripMenuItem});
  222.                         this->menuStrip1->Location = System::Drawing::Point(0, 0);
  223.                         this->menuStrip1->Name = L"menuStrip1";
  224.                         this->menuStrip1->Size = System::Drawing::Size(292, 24);
  225.                         this->menuStrip1->TabIndex = 9;
  226.                         this->menuStrip1->Text = L"menuStrip1";
  227.                         //
  228.                         // fileToolStripMenuItem
  229.                         //
  230.                         this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->salvaToolStripMenuItem,
  231.                                 this->calcolaTempoTotaleToolStripMenuItem, this->exitToolStripMenuItem});
  232.                         this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
  233.                         this->fileToolStripMenuItem->Size = System::Drawing::Size(35, 20);
  234.                         this->fileToolStripMenuItem->Text = L"File";
  235.                         //
  236.                         // salvaToolStripMenuItem
  237.                         //
  238.                         this->salvaToolStripMenuItem->Name = L"salvaToolStripMenuItem";
  239.                         this->salvaToolStripMenuItem->Size = System::Drawing::Size(183, 22);
  240.                         this->salvaToolStripMenuItem->Text = L"Salva";
  241.                         this->salvaToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::salvaToolStripMenuItem_Click);
  242.                         //
  243.                         // calcolaTempoTotaleToolStripMenuItem
  244.                         //
  245.                         this->calcolaTempoTotaleToolStripMenuItem->Name = L"calcolaTempoTotaleToolStripMenuItem";
  246.                         this->calcolaTempoTotaleToolStripMenuItem->Size = System::Drawing::Size(183, 22);
  247.                         this->calcolaTempoTotaleToolStripMenuItem->Text = L"Calcola tempo totale";
  248.                         this->calcolaTempoTotaleToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::calcolaTempoTotaleToolStripMenuItem_Click);
  249.                         //
  250.                         // exitToolStripMenuItem
  251.                         //
  252.                         this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
  253.                         this->exitToolStripMenuItem->Size = System::Drawing::Size(183, 22);
  254.                         this->exitToolStripMenuItem->Text = L"Exit";
  255.                         this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
  256.                         //
  257.                         // textBox2
  258.                         //
  259.                         this->textBox2->Location = System::Drawing::Point(58, 295);
  260.                         this->textBox2->Multiline = true;
  261.                         this->textBox2->Name = L"textBox2";
  262.                         this->textBox2->ScrollBars = System::Windows::Forms::ScrollBars::Both;
  263.                         this->textBox2->Size = System::Drawing::Size(170, 20);
  264.                         this->textBox2->TabIndex = 10;
  265.                         this->textBox2->Text = L"TEMPO TOTALE :\r\nPAUSE TOTALI :";
  266.                         //
  267.                         // Form1
  268.                         //
  269.                         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  270.                         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  271.                         this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"$this.BackgroundImage")));
  272.                         this->ClientSize = System::Drawing::Size(292, 334);
  273.                         this->Controls->Add(this->textBox2);
  274.                         this->Controls->Add(this->button3);
  275.                         this->Controls->Add(this->button2);
  276.                         this->Controls->Add(this->button1);
  277.                         this->Controls->Add(this->label5);
  278.                         this->Controls->Add(this->textBox1);
  279.                         this->Controls->Add(this->label4);
  280.                         this->Controls->Add(this->label3);
  281.                         this->Controls->Add(this->label2);
  282.                         this->Controls->Add(this->label1);
  283.                         this->Controls->Add(this->menuStrip1);
  284.                         this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
  285.                         this->Location = System::Drawing::Point(10, 10);
  286.                         this->MainMenuStrip = this->menuStrip1;
  287.                         this->MaximizeBox = false;
  288.                         this->Name = L"Form1";
  289.                         this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
  290.                         this->Text = L"Stage";
  291.                         this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  292.                         this->menuStrip1->ResumeLayout(false);
  293.                         this->menuStrip1->PerformLayout();
  294.                         this->ResumeLayout(false);
  295.                         this->PerformLayout();
  296.  
  297.                 }
  298. #pragma endregion
  299.         private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e)
  300.                          {
  301.                         DateTime d1 = DateTime::Now;
  302.                                 tmp=d1.Hour.ToString();
  303.                                 String^ tmp2(d1.Minute.ToString());
  304.                             tmp=System::String::Concat(tmp,":",tmp2);
  305.                                 this->label2->Text=tmp;
  306.                                 tmp=d1.Day.ToString();
  307.                                 tmp2=d1.Month.ToString();
  308.                                 String^ tmp3(d1.Year.ToString());
  309.                                 tmp=System::String::Concat(tmp,"/",tmp2,"/",tmp3);
  310.                                 this->label4->Text=tmp;
  311.                         //      ProgettoStageReal::ThreadExample^ tws=gcnew ProgettoStageReal::ThreadExample(this->label2);
  312.                         //      Thread^ t = gcnew Thread(gcnew ThreadStart(tws, &ThreadExample::DoWork));
  313.                         //      t->Start();
  314.                                 //ale2^ prova;
  315.                                 //prova->setta(this->label2);
  316.                                 //prova->go();
  317.                                
  318.                                
  319.                          }
  320.  
  321.         private: System::Void notifyIcon1_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e)
  322.                          {
  323.                                  this->Show();
  324.                                  //this->ZeroStage->Visible = true;
  325.                          }
  326.        
  327.        
  328.  
  329.        
  330.  
  331. //PLAY 
  332. private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
  333.                          {
  334.                                 this->Hide();
  335.                                  if (this->ZeroStage->Visible)
  336.                                  {
  337.                                         tws->settapausa(0);
  338.                                  }
  339.                                  else
  340.                                  {
  341.                                         this->ZeroStage->Visible = true;
  342.                                         tws=gcnew ProgettoStageReal::ThreadExample(this->textBox2);
  343.                                         Thread^ t = gcnew Thread(gcnew ThreadStart(tws, &ThreadExample::DoWork));
  344.                                         t->Start();
  345.                                  }
  346.                          }
  347.  
  348. //STOP
  349. private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e)
  350.                  {
  351.                          if (this->ZeroStage->Visible)
  352.                          {
  353.                                  this->ZeroStage->Visible = false;
  354.                                  tws->settavai(0);
  355.  
  356.                          }
  357.                  }
  358. //PAUSE
  359. private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e)
  360.                  {
  361.                          if (this->ZeroStage->Visible)
  362.                          {
  363.                                  tws->settapausa(1);
  364.                          }
  365.  
  366.  
  367.                  }
  368. private: System::Void salvaToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e)
  369.                          {
  370.                                  try {
  371.                                  Stream^ myStream;
  372.                                   SaveFileDialog^ saveFileDialog1 = gcnew SaveFileDialog;
  373.                                   saveFileDialog1->Filter = "4x4 files (*.4x4)|*.4x4";
  374.                                   saveFileDialog1->FilterIndex = 1;
  375.                                   saveFileDialog1->RestoreDirectory = true;
  376.                                   saveFileDialog1->ShowDialog();
  377.                                    if ( (myStream = saveFileDialog1->OpenFile()) != nullptr )
  378.                                          {
  379.                                     StreamWriter^ scr=gcnew StreamWriter(myStream);
  380.                                                 scr->WriteLine(Definizioni::intro+"\r\n\r\n\r\n"+Definizioni::intro2+" "+tmp+"\r\n");
  381.                                                 scr->WriteLine(Definizioni::asterisco+"\r\n\r\n"+this->textBox1->Text+"\r\n\r\n"+Definizioni::asterisco+"\r\n");
  382.                                                 String^ liz=this->textBox2->Text;
  383.                                                 int m=liz->LastIndexOf("\r\n");
  384.                                                 liz=liz->Remove(m);
  385.  
  386.                                                 //MessageBox::Show(liz);
  387.                                                 scr->WriteLine(liz);
  388.                                                 scr->Close();
  389.                                                 // Code to write the stream goes here.
  390.                                                 myStream->Close();
  391.                                          }
  392.                           }
  393.                                  catch (Exception^ e)
  394.                                  {
  395.                                          MessageBox::Show("Problema nel salvataggio");
  396.                                  }
  397.                                  
  398.                         }
  399.  
  400. private: System::Void calcolaTempoTotaleToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e)
  401.                  {
  402.                          try {
  403.                          OpenFileDialog^ openfile= gcnew OpenFileDialog;
  404.                          openfile->Filter ="4x4'files (*.4x4)|*.4x4;";
  405.                          openfile->Multiselect = true;
  406.                          openfile->ShowDialog();
  407.                                                  
  408.                          array<String^>^ nomifile=openfile->FileNames;
  409.                          int totale_ore=0;
  410.                          int totale_min=0;
  411.                          for(int i=0; i<nomifile->Length;i++)
  412.                          {
  413.                                  StreamReader^ sr = gcnew StreamReader((String^)nomifile->GetValue(i) );
  414.                                   try
  415.                                   {
  416.                                          String^ line;
  417.                                  int count=0;
  418.                                          int temp_ora,temp_min;
  419.                                          // Read and display lines from the file until the end of
  420.                                          // the file is reached.
  421.                                          while ( line = sr->ReadLine() )
  422.                                          {
  423.                                                  if (count==2)
  424.                                                  {
  425.                                                         String^ ora,^minuti;
  426.                                                         line=sr->ReadLine();
  427.                                                         int pr=line->IndexOf(":");
  428.                                                         line=line->Substring(pr+1);
  429.                                                         pr=line->IndexOf(",");
  430.                                                         ora=line->Remove(pr-1);
  431.                                                         line=line->Substring(pr+1);
  432.                                                         pr=line->IndexOf("m");
  433.                                                         minuti=line->Remove(pr-1);
  434.                                                         temp_ora=System::Convert::ToInt32(ora);
  435.                                                         temp_min=System::Convert::ToInt32(minuti);
  436.                                                         totale_ore += temp_ora;
  437.                                                         totale_min += temp_min;
  438.                                                         //MessageBox::Show(totale_ore.ToString()+" "+totale_min.ToString());
  439.                                                  }
  440.                                                  if ((line->CompareTo(Definizioni::asterisco))==0)
  441.                                                  {
  442.                                                          count++;
  443.                                                  }
  444.                                          }
  445.                                        
  446.                                   }
  447.                                  
  448.                                   catch ( Exception^ e )
  449.                               {
  450.                                           // Let the user know what went wrong.
  451.                                           Console::WriteLine( "The file could not be read:" );
  452.                                           Console::WriteLine( e->Message );
  453.                                    }
  454.                                    finally
  455.                                   {
  456.                                          if ( sr )
  457.                                                 delete (IDisposable^)sr;
  458.                                   }
  459.                                  //MessageBox::Show((String^)nomifile->GetValue(i));
  460.                          }
  461.                          while(totale_min>=60)
  462.                                  {
  463.                                          totale_ore++;
  464.                                          totale_min -= 60;
  465.                                  }
  466.                          String^ finisco=this->textBox2->Text;
  467.                         //calcolo tempo rimanente prima della fine dello stage
  468.                          int min_mancanti=Definizioni::ore_mancanti*60;
  469.                          int min_fatti=(totale_ore*60)+totale_min;
  470.                          int diff,ore_restanti,min_restanti,gg_restanti,ggo_restanti;
  471.                          diff=ore_restanti=min_restanti=gg_restanti=ggo_restanti=0;
  472.                          if (min_mancanti<min_fatti)
  473.                                  MessageBox::Show("ComplimenTi, hai raggiunto il tuo obbiettivo");
  474.                          else
  475.                          {
  476.                                 diff=min_mancanti-min_fatti;
  477.                                 ore_restanti=diff/60;
  478.                                 min_restanti=diff%60;
  479.                                 gg_restanti=ore_restanti/24;
  480.                                 ggo_restanti=ore_restanti%24;
  481.                          }
  482.                          finisco=String::Concat(finisco,"\r\n","ORE TOTALI STAGE :","\r\n",totale_ore.ToString()," ore e ",totale_min.ToString()," min","\r\n",
  483.                                  "TEMPO RIMASTO ALLA FINE\r\n",ore_restanti," ore e ",min_restanti," min\r\nOssia\r\n",gg_restanti," giorni e ",ggo_restanti," ore");
  484.                          
  485.                          this->textBox2->Text=finisco;
  486.                          }
  487.                          catch (...)
  488.                          {
  489.                                 MessageBox::Show("Problema nel calcolo del totale");
  490.                          }
  491.  
  492.  
  493.                  }
  494. private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e)
  495.                  {
  496.                          if (this->ZeroStage->Visible)
  497.                          {
  498.                                  this->ZeroStage->Visible = false;
  499.                                  tws->settavai(0);
  500.                                  Thread::Sleep(501);
  501.                                  
  502.                          }
  503.                          this->Close();
  504.                                  
  505.                  }
  506. };
  507.  
  508.  
  509.  
  510. }