Treceți la conținutul principal

calculator baze nr code

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace BooleaOps
{
 /// <summary>
 /// Summary description for Form1.
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button unu;
  private System.Windows.Forms.Button doi;
  private System.Windows.Forms.Button trei;
  private System.Windows.Forms.Button patru;
  private System.Windows.Forms.Button cinci;
  private System.Windows.Forms.Button sase;
  private System.Windows.Forms.Button noua;
  private System.Windows.Forms.Button sapte;
  private System.Windows.Forms.Button opt;
  private System.Windows.Forms.Button zero;
  private System.Windows.Forms.Button plus;
  private System.Windows.Forms.Button egal;
  private System.Windows.Forms.Button mult;
  private System.Windows.Forms.Button div;
  private System.Windows.Forms.Button minus;
  private System.Windows.Forms.Button punct;
  private System.Windows.Forms.Button virgula;
  private System.Windows.Forms.TextBox textBox1;
  private System.Windows.Forms.Button Cancel;
  private System.Windows.Forms.Button btbback;
  private System.Windows.Forms.Button btnSign;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.Button button3;
  private System.Windows.Forms.TextBox textBox2;
  private System.Windows.Forms.MainMenu mainMenu1;
  private System.Windows.Forms.MenuItem menuItem1;
  private System.Windows.Forms.MenuItem menuItem2;
  /// <summary>
  /// Required designer variable.
  /// </summary>
  private System.ComponentModel.Container components = null;

  public Form1()
  {
   //
   // Required for Windows Form Designer support
   //
   InitializeComponent();

   //
   // TODO: Add any constructor code after InitializeComponent call
   //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null) 
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
   this.button1 = new System.Windows.Forms.Button();
   this.unu = new System.Windows.Forms.Button();
   this.doi = new System.Windows.Forms.Button();
   this.trei = new System.Windows.Forms.Button();
   this.cinci = new System.Windows.Forms.Button();
   this.patru = new System.Windows.Forms.Button();
   this.sase = new System.Windows.Forms.Button();
   this.noua = new System.Windows.Forms.Button();
   this.sapte = new System.Windows.Forms.Button();
   this.opt = new System.Windows.Forms.Button();
   this.plus = new System.Windows.Forms.Button();
   this.egal = new System.Windows.Forms.Button();
   this.zero = new System.Windows.Forms.Button();
   this.mult = new System.Windows.Forms.Button();
   this.div = new System.Windows.Forms.Button();
   this.minus = new System.Windows.Forms.Button();
   this.punct = new System.Windows.Forms.Button();
   this.virgula = new System.Windows.Forms.Button();
   this.textBox1 = new System.Windows.Forms.TextBox();
   this.Cancel = new System.Windows.Forms.Button();
   this.btbback = new System.Windows.Forms.Button();
   this.btnSign = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.button3 = new System.Windows.Forms.Button();
   this.textBox2 = new System.Windows.Forms.TextBox();
   this.mainMenu1 = new System.Windows.Forms.MainMenu();
   this.menuItem1 = new System.Windows.Forms.MenuItem();
   this.menuItem2 = new System.Windows.Forms.MenuItem();
   this.SuspendLayout();
   // 
   // button1
   // 
   this.button1.Location = new System.Drawing.Point(232, 80);
   this.button1.Name = "button1";
   this.button1.Size = new System.Drawing.Size(40, 24);
   this.button1.TabIndex = 2;
   this.button1.Text = "Enter";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   // 
   // unu
   // 
   this.unu.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.unu.Location = new System.Drawing.Point(40, 80);
   this.unu.Name = "unu";
   this.unu.Size = new System.Drawing.Size(32, 24);
   this.unu.TabIndex = 3;
   this.unu.Text = "1";
   this.unu.Click += new System.EventHandler(this.unu_Click);
   // 
   // doi
   // 
   this.doi.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.doi.Location = new System.Drawing.Point(72, 80);
   this.doi.Name = "doi";
   this.doi.Size = new System.Drawing.Size(32, 24);
   this.doi.TabIndex = 4;
   this.doi.Text = "2";
   this.doi.Click += new System.EventHandler(this.doi_Click);
   // 
   // trei
   // 
   this.trei.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.trei.Location = new System.Drawing.Point(104, 80);
   this.trei.Name = "trei";
   this.trei.Size = new System.Drawing.Size(32, 24);
   this.trei.TabIndex = 5;
   this.trei.Text = "3";
   this.trei.Click += new System.EventHandler(this.trei_Click);
   // 
   // cinci
   // 
   this.cinci.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.cinci.Location = new System.Drawing.Point(72, 104);
   this.cinci.Name = "cinci";
   this.cinci.Size = new System.Drawing.Size(32, 24);
   this.cinci.TabIndex = 4;
   this.cinci.Text = "5";
   this.cinci.Click += new System.EventHandler(this.cinci_Click);
   // 
   // patru
   // 
   this.patru.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.patru.Location = new System.Drawing.Point(40, 104);
   this.patru.Name = "patru";
   this.patru.Size = new System.Drawing.Size(32, 24);
   this.patru.TabIndex = 3;
   this.patru.Text = "4";
   this.patru.Click += new System.EventHandler(this.patru_Click);
   // 
   // sase
   // 
   this.sase.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.sase.Location = new System.Drawing.Point(104, 104);
   this.sase.Name = "sase";
   this.sase.Size = new System.Drawing.Size(32, 24);
   this.sase.TabIndex = 5;
   this.sase.Text = "6";
   this.sase.Click += new System.EventHandler(this.sase_Click);
   // 
   // noua
   // 
   this.noua.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.noua.Location = new System.Drawing.Point(104, 128);
   this.noua.Name = "noua";
   this.noua.Size = new System.Drawing.Size(32, 24);
   this.noua.TabIndex = 5;
   this.noua.Text = "9";
   this.noua.Click += new System.EventHandler(this.noua_Click);
   // 
   // sapte
   // 
   this.sapte.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.sapte.Location = new System.Drawing.Point(40, 128);
   this.sapte.Name = "sapte";
   this.sapte.Size = new System.Drawing.Size(32, 24);
   this.sapte.TabIndex = 3;
   this.sapte.Text = "7";
   this.sapte.Click += new System.EventHandler(this.sapte_Click);
   // 
   // opt
   // 
   this.opt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.opt.Location = new System.Drawing.Point(72, 128);
   this.opt.Name = "opt";
   this.opt.Size = new System.Drawing.Size(32, 24);
   this.opt.TabIndex = 4;
   this.opt.Text = "8";
   this.opt.Click += new System.EventHandler(this.button10_Click);
   // 
   // plus
   // 
   this.plus.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.plus.Location = new System.Drawing.Point(184, 80);
   this.plus.Name = "plus";
   this.plus.Size = new System.Drawing.Size(24, 24);
   this.plus.TabIndex = 5;
   this.plus.Text = "+";
   this.plus.Click += new System.EventHandler(this.plus_Click);
   // 
   // egal
   // 
   this.egal.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.egal.Location = new System.Drawing.Point(152, 80);
   this.egal.Name = "egal";
   this.egal.Size = new System.Drawing.Size(24, 24);
   this.egal.TabIndex = 3;
   this.egal.Text = "=";
   this.egal.Click += new System.EventHandler(this.egal_Click);
   // 
   // zero
   // 
   this.zero.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.zero.Location = new System.Drawing.Point(40, 152);
   this.zero.Name = "zero";
   this.zero.Size = new System.Drawing.Size(32, 24);
   this.zero.TabIndex = 4;
   this.zero.Text = "0";
   this.zero.Click += new System.EventHandler(this.zero_Click);
   // 
   // mult
   // 
   this.mult.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.mult.Location = new System.Drawing.Point(184, 152);
   this.mult.Name = "mult";
   this.mult.Size = new System.Drawing.Size(24, 24);
   this.mult.TabIndex = 4;
   this.mult.Text = "*";
   this.mult.Click += new System.EventHandler(this.mult_Click);
   // 
   // div
   // 
   this.div.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.div.Location = new System.Drawing.Point(184, 128);
   this.div.Name = "div";
   this.div.Size = new System.Drawing.Size(24, 24);
   this.div.TabIndex = 3;
   this.div.Text = "/";
   this.div.Click += new System.EventHandler(this.div_Click);
   // 
   // minus
   // 
   this.minus.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.minus.Location = new System.Drawing.Point(184, 104);
   this.minus.Name = "minus";
   this.minus.Size = new System.Drawing.Size(24, 24);
   this.minus.TabIndex = 5;
   this.minus.Text = "-";
   this.minus.Click += new System.EventHandler(this.minus_Click);
   // 
   // punct
   // 
   this.punct.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.punct.Location = new System.Drawing.Point(152, 128);
   this.punct.Name = "punct";
   this.punct.Size = new System.Drawing.Size(24, 24);
   this.punct.TabIndex = 4;
   this.punct.Text = ".";
   this.punct.Click += new System.EventHandler(this.punct_Click);
   // 
   // virgula
   // 
   this.virgula.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.virgula.Location = new System.Drawing.Point(152, 152);
   this.virgula.Name = "virgula";
   this.virgula.Size = new System.Drawing.Size(24, 24);
   this.virgula.TabIndex = 4;
   this.virgula.Text = ",";
   this.virgula.Click += new System.EventHandler(this.virgula_Click);
   // 
   // textBox1
   // 
   this.textBox1.Enabled = false;
   this.textBox1.Location = new System.Drawing.Point(8, 32);
   this.textBox1.Name = "textBox1";
   this.textBox1.Size = new System.Drawing.Size(272, 20);
   this.textBox1.TabIndex = 6;
   this.textBox1.Text = "";
   this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
   // 
   // Cancel
   // 
   this.Cancel.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.Cancel.Location = new System.Drawing.Point(232, 128);
   this.Cancel.Name = "Cancel";
   this.Cancel.Size = new System.Drawing.Size(40, 24);
   this.Cancel.TabIndex = 3;
   this.Cancel.Text = "C";
   this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
   // 
   // btbback
   // 
   this.btbback.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.btbback.Location = new System.Drawing.Point(232, 104);
   this.btbback.Name = "btbback";
   this.btbback.Size = new System.Drawing.Size(40, 24);
   this.btbback.TabIndex = 3;
   this.btbback.Text = "<-";
   this.btbback.Click += new System.EventHandler(this.btbback_Click);
   // 
   // btnSign
   // 
   this.btnSign.Font = new System.Drawing.Font("OCR A Extended", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.btnSign.Location = new System.Drawing.Point(8, 80);
   this.btnSign.Name = "btnSign";
   this.btnSign.Size = new System.Drawing.Size(24, 24);
   this.btnSign.TabIndex = 4;
   this.btnSign.Text = "+-";
   this.btnSign.Click += new System.EventHandler(this.btnSign_Click);
   // 
   // button2
   // 
   this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.button2.Location = new System.Drawing.Point(72, 152);
   this.button2.Name = "button2";
   this.button2.Size = new System.Drawing.Size(32, 24);
   this.button2.TabIndex = 4;
   this.button2.Text = "00";
   this.button2.Click += new System.EventHandler(this.button2_Click);
   // 
   // button3
   // 
   this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.button3.Location = new System.Drawing.Point(104, 152);
   this.button3.Name = "button3";
   this.button3.Size = new System.Drawing.Size(40, 24);
   this.button3.TabIndex = 4;
   this.button3.Text = "000";
   this.button3.Click += new System.EventHandler(this.button3_Click);
   // 
   // textBox2
   // 
   this.textBox2.Location = new System.Drawing.Point(288, 32);
   this.textBox2.Multiline = true;
   this.textBox2.Name = "textBox2";
   this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both;
   this.textBox2.Size = new System.Drawing.Size(168, 296);
   this.textBox2.TabIndex = 7;
   this.textBox2.Text = "Solve:";
   this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
   // 
   // mainMenu1
   // 
   this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                       this.menuItem1});
   // 
   // menuItem1
   // 
   this.menuItem1.Index = 0;
   this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                       this.menuItem2});
   this.menuItem1.Text = "Help";
   // 
   // menuItem2
   // 
   this.menuItem2.Index = 0;
   this.menuItem2.Text = "About";
   this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
   // 
   // Form1
   // 
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   this.ClientSize = new System.Drawing.Size(472, 333);
   this.Controls.Add(this.textBox2);
   this.Controls.Add(this.textBox1);
   this.Controls.Add(this.trei);
   this.Controls.Add(this.doi);
   this.Controls.Add(this.unu);
   this.Controls.Add(this.button1);
   this.Controls.Add(this.cinci);
   this.Controls.Add(this.patru);
   this.Controls.Add(this.sase);
   this.Controls.Add(this.noua);
   this.Controls.Add(this.sapte);
   this.Controls.Add(this.opt);
   this.Controls.Add(this.plus);
   this.Controls.Add(this.egal);
   this.Controls.Add(this.zero);
   this.Controls.Add(this.mult);
   this.Controls.Add(this.div);
   this.Controls.Add(this.minus);
   this.Controls.Add(this.punct);
   this.Controls.Add(this.virgula);
   this.Controls.Add(this.Cancel);
   this.Controls.Add(this.btbback);
   this.Controls.Add(this.btnSign);
   this.Controls.Add(this.button2);
   this.Controls.Add(this.button3);
   this.Menu = this.mainMenu1;
   this.Name = "Form1";
   this.Text = "Calculator";
   this.Load += new System.EventHandler(this.Form1_Load);
   this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main() 
  {
   Application.Run(new Form1());
  }
  
  int opcod;
  int pct,vrgula;

  double nr1,nr2,nr3;
  private void button1_Click(object sender, System.EventArgs e)
  {
            this.egal.Enabled = true;
            this.textBox1.Text = "";
            nr1 = nr2 = nr3 = 0;
  }

  private void button10_Click(object sender, System.EventArgs e)
  {
   this.textBox1.AppendText("8");
  }

  private void Form1_Load(object sender, System.EventArgs e)
  {
  nr1=0;nr2=0;nr3=0;
   this.btnSign.Enabled=false;
   this.virgula.Enabled=false;
  }

  private void unu_Click(object sender, System.EventArgs e)
  {
   this.textBox1.AppendText("1");
  }

  private void doi_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("2");
  }

  private void trei_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("3");
  }

  private void patru_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("4");
  }

  private void cinci_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("5");
  }

  private void sase_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("6");
  }

  private void sapte_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("7");
  }

  private void noua_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("9");
  }

  private void zero_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText("0");
  }

  private void Cancel_Click(object sender, System.EventArgs e)
  {
   //if (MessageBox.Show("Erase ?", "Erase the datas", MessageBoxButtons.OKCancel) == DialogResult.OK)
   //{
    this.textBox1.Text="";
   //}
   this.punct.Enabled=true;
   this.virgula.Enabled=true;
  }

  private void btbback_Click(object sender, System.EventArgs e)
  {
   if (this.textBox1.CanUndo == true)
   {
    this.textBox1.Undo( );
    this.textBox1.ClearUndo();
   }
  }

  private void plus_Click(object sender, System.EventArgs e)
  {
  opcod = 1;//plus
   if(this.textBox1.Text!="")
   {
    nr1=double.Parse(this.textBox1.Text);
    this.textBox1.Text="";
   }
  }

  private void minus_Click(object sender, System.EventArgs e)
  {
   opcod = 2;//minus
   if(this.textBox1.Text!="")
   {
    nr1=double.Parse(this.textBox1.Text);
    this.textBox1.Text="";
   }
  }

  private void div_Click(object sender, System.EventArgs e)
  {
   opcod = 3;//divide
   if(this.textBox1.Text!="")
   {
    nr1=double.Parse(this.textBox1.Text);
    this.textBox1.Text="";
   }
  }

  private void mult_Click(object sender, System.EventArgs e)
  {
   opcod = 4;//multiply
   if(this.textBox1.Text!="")
   {
    nr1=double.Parse(this.textBox1.Text);
    this.textBox1.Text="";
   }
  }

  private void punct_Click(object sender, System.EventArgs e)
  {
   this.textBox1.AppendText(".");
   this.punct.Enabled=false;
   this.virgula.Enabled=false;
   pct=1;
   vrgula=0;
  }

  private void virgula_Click(object sender, System.EventArgs e)
  {
  this.textBox1.AppendText(",");
   this.punct.Enabled=false;
   this.virgula.Enabled=false;
   pct=0;
   vrgula=1;
  }

  private void egal_Click(object sender, System.EventArgs e)
  {
            this.egal.Enabled = false;
            this.textBox2.Text = "";
   this.textBox2.AppendText("\r\n_____________________\r\n");
   this.textBox2.AppendText(Convert.ToString(nr1)+"  ");
   string operation;
   operation=" ";
   if(this.textBox1.Text!="")
   {
    nr2=double.Parse(this.textBox1.Text);
   }
   else
   {
    if(MessageBox.Show("Error", "No data", MessageBoxButtons.OK) == DialogResult.OK){
    this.textBox1.Text = Convert.ToString(nr1);
    nr2=double.Parse(this.textBox1.Text);
    }

   }
   
   if(opcod==1)
   {
   nr3=nr1+nr2;
    this.textBox1.Text = Convert.ToString(nr3);
    operation="+";
   }
   if(opcod==2)
   {
    nr3=nr1-nr2;
    this.textBox1.Text = Convert.ToString(nr3);
    operation="-";
   }
   if(opcod==3)
   {
    nr3=nr1/nr2;
    this.textBox1.Text = Convert.ToString(nr3);
    operation="/";
   }
   if(opcod==4)
   {
    nr3=nr1*nr2;
    this.textBox1.Text = Convert.ToString(nr3);
    operation="*";
   }
   this.textBox2.AppendText(operation +"  \r\n");
   this.textBox2.AppendText(Convert.ToString(nr2)+"  \r\n");
   this.textBox2.AppendText(" = \r\n");
   this.textBox2.AppendText(Convert.ToString(nr3)+ "\r\n");
   opcod=0;

  }

  private void btnSign_Click(object sender, System.EventArgs e)
  {
   double valOftextBox1;
   this.btnSign.Enabled=false;
   if(this.textBox1.Text!="" || this.textBox1.Text!="."|| this.textBox1.Text!=",")
   {

    valOftextBox1 = double.Parse(this.textBox1.Text);
    if(double.Parse(this.textBox1.Text)<0)
    {
     this.textBox1.Text = "+" + Convert.ToString(valOftextBox1);
    }
    else if(double.Parse(this.textBox1.Text)>0)
    {
     this.textBox1.Text = "-" + Convert.ToString(valOftextBox1);
    }
   }
   
   
  }

  private void button2_Click(object sender, System.EventArgs e)
  {
   this.textBox1.AppendText("00");
  }

  private void button3_Click(object sender, System.EventArgs e)
  {
   this.textBox1.AppendText("000");
  }

  private void textBox1_TextChanged(object sender, System.EventArgs e)
  {
   
  }

  private void textBox2_TextChanged(object sender, System.EventArgs e)
  {
  
  }

  private void menuItem2_Click(object sender, System.EventArgs e)
  {
   Form2 aboutfrm = new Form2();
   aboutfrm.Show();
  }

  
 }
}




Comentarii

Postări populare de pe acest blog

program principal cpp

#include "clasa.h" #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define DELAY 9000000 void delay() { for(long i=0;i<DELAY;i++); } //constructor cu initializare de la tastatura BigInt::BigInt() {char x; signed char t[400]; int i; printf("\nNumarul cu semn "); do s=getche(); while((s!='+')&&(s!='-')); n=0; do {x=getche(); t[n]=x-'0'; n++; } while((x>='0')&&(x<='9')); n--; for(i=0;i<n;i++) nr[i]=t[n-i-1]; } //constructor cu initializare prin parametri BigInt::BigInt(char semn,signed char numar[],int dim) {int i; s=semn; n=dim; for(i=0;i<n;i++) nr[i]=numar[n-i-1]; } //transform un int negativ in pozitiv int BigInt::Pozitiv(int x) {int a,vb; a=0; vb=0; while(vb==0) if((x+a)==0) vb=1; else a=a+1; x=a; return x; } //constructor dintr-un nr int obisnuit BigInt::BigInt(int x) {int i; if(x>=0) s='+'…

NUMERE PRIME ALGORITM C++

// NUMERE PRIME ALGORITM C++//  reediting from scratch //on this page is just the study for a next algoritm for generating the parime nr series like Fibonnaci or ....if possibile

74111121313417374414124343447 if u know the red part you can generate the orange part
1 0 1 111112222 1 1 23

o aplicatie php localitati romania

//APLICATIA SE REFERA LA BAZA DE DATE SIRUTA

//dragtable.js


/* dragtable v1.0 June 26, 2008 Dan Vanderkam, http://danvk.org/dragtable/ http://code.google.com/p/dragtable/ \Bsortabledraggable\B Instructions: - Download this file - Add <script src="dragtable.js"></script> to your HTML. - Add class="draggable" to any table you might like to reorder. - Drag the headers around to reorder them. This is code was based on: - Stuart Langridge's SortTable (kryogenix.org/code/browser/sorttable) - Mike Hall's draggable class (http://www.brainjar.com/dhtml/drag/) - A discussion of permuting table columns on comp.lang.javascript Licensed under the MIT license. */ // Here's the notice from Mike Hall's draggable script: //***************************************************************************** // Do not remove this notice. // // Copyright 2001 by Mike Hall. // See http…