using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
private void Form1_Load( sender, EventArgs e){
}
private void timer1_Tick( sender, EventArgs e){
textBox1.Text =
Convert.ToString((int.Parse(textBox1.Text) + 1)); if ((int.Parse(textBox1.Text))==100){
textBox1.Text=
Convert.ToString(0);textBox2.Text =
Convert.ToString((int.Parse(textBox2.Text) + 1)); if ((int.Parse(textBox2.Text)) == 60){
textBox2.Text =
Convert.ToString(0);textBox3.Text =
Convert.ToString((int.Parse(textBox3.Text) + 1)); if ((int.Parse(textBox3.Text)) == 60){
textBox3.Text =
Convert.ToString(0);textBox4.Text =
Convert.ToString((int.Parse(textBox4.Text) + 1));}
}
}
}
private void button1_Click( sender, EventArgs e){
timer1.Start();
}
private void button2_Click( sender, EventArgs e){
}
private void button3_Click( sender, EventArgs e){
timer1.Stop();
}
}
}
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
bool key=true ; byte op; int num1; public Form1(){
InitializeComponent();
}
private void Form1_Load( sender, EventArgs e){
}
private void button1_Click( sender, EventArgs e){
}
private void button2_Click( sender, EventArgs e){
}
private void button1_Click_1( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"1"; else{
textBox1.Clear();
textBox1.Text =
"1";key =
true;}
}
private void button13_Click( sender, EventArgs e){
key =
false;op = 1;
num1 =
Convert.ToInt16(textBox1.Text);}
private void button12_Click( sender, EventArgs e){
int num3; int num2 = Convert.ToInt16 (textBox1.Text); switch (op){
case 1:num3=num1+num2;
textBox1.Text = num3.ToString();
break; case 2:num3 = num1 - num2;
textBox1.Text = num3.ToString();
break; case 3:num3 = num1 * num2;
textBox1.Text = num3.ToString();
break; case 4:num3 = num1 / num2;
textBox1.Text = num3.ToString();
break;}
}
private void button2_Click_1( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"2"; else{
textBox1.Clear();
textBox1.Text =
"2";key =
true;}
}
private void button3_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"3"; else{
textBox1.Clear();
textBox1.Text =
"3";key =
true;}
}
private void button4_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"4"; else{
textBox1.Clear();
textBox1.Text =
"4";key =
true;}
}
private void button5_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"5"; else{
textBox1.Clear();
textBox1.Text =
"5";key =
true;}
}
private void button6_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"6"; else{
textBox1.Clear();
textBox1.Text =
"6";key =
true;}
}
private void button7_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"7"; else{
textBox1.Clear();
textBox1.Text =
"7";key =
true;}
}
private void button8_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"8"; else{
textBox1.Clear();
textBox1.Text =
"8";key =
true;}
}
private void button9_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"9"; else{
textBox1.Clear();
textBox1.Text =
"9";key =
true;}
}
private void button10_Click( sender, EventArgs e){
if (key)textBox1.Text = textBox1.Text +
"0"; else{
textBox1.Clear();
textBox1.Text =
"0";key =
true;}
}
private void button14_Click( sender, EventArgs e){
key =
false;op = 2;
num1 =
Convert.ToInt16(textBox1.Text);}
private void button15_Click( sender, EventArgs e){
key =
false;op = 3;
num1 =
Convert.ToInt16(textBox1.Text);}
private void button16_Click( sender, EventArgs e){
key =
false;op = 4;
num1 =
Convert.ToInt16(textBox1.Text);}
}
}
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
bool p = true; int a, b, c; byte mod; public Form1(){
InitializeComponent();
}
private void Form1_Load( sender, EventArgs e){
}
private void button1_Click( sender, EventArgs e){
if (p)textBox1.Text += button1.Text;
else{
textBox1.Text =
"";textBox1.Text += button1.Text;
}
p =
true;}
private void button2_Click( sender, EventArgs e){
if (p)textBox1.Text += button2.Text;
else{
textBox1.Text =
"";textBox1.Text += button2.Text;
}
p =
true;}
private void button3_Click( sender, EventArgs e){
if (p)textBox1.Text += button3.Text;
else{
textBox1.Text =
"";textBox1.Text += button3.Text;
}
}
private void button4_Click( sender, EventArgs e){
if (p)textBox1.Text += button4.Text;
else{
textBox1.Text =
"";textBox1.Text += button4.Text;
}
}
private void button5_Click( sender, EventArgs e){
if (p)textBox1.Text += button5.Text;
else{
textBox1.Text =
"";textBox1.Text += button5.Text;
}
}
private void button6_Click( sender, EventArgs e){
if (p)textBox1.Text += button6.Text;
else{
textBox1.Text =
"";textBox1.Text += button6.Text;
}
}
private void button7_Click( sender, EventArgs e){
if (p)textBox1.Text += button7.Text;
else{
textBox1.Text =
"";textBox1.Text += button7.Text;
}
}
private void button8_Click( sender, EventArgs e){
if (p)textBox1.Text += button8.Text;
else{
textBox1.Text =
"";textBox1.Text += button8.Text;
}
}
private void button9_Click( sender, EventArgs e){
if (p)textBox1.Text += button9.Text;
else{
textBox1.Text =
"";textBox1.Text += button9.Text;
}
}
private void button10_Click( sender, EventArgs e){
if (p)textBox1.Text += button10.Text;
else{
textBox1.Text =
"";textBox1.Text += button10.Text;
}
}
private void button11_Click( sender, EventArgs e){
a =
Convert.ToInt16(textBox1.Text );p =
false;mod = 1;
}
private void button12_Click( sender, EventArgs e){
b =
Convert.ToInt16(textBox1.Text ); switch (mod){
case 1:c = a + b;
break;}
textBox1.Text = c.ToString();
p =
true;}
private void button13_Click( sender, EventArgs e){
double x = Convert.ToDouble(textBox1.Text);textBox1.Text=
Math.Sin(x).ToString();}
}
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
Calculater{
public partial class Form1 : Form{
bool p = true; public Form1(){
InitializeComponent();
}
private void button9_Click( sender, EventArgs e){
if (p)textBox1.Text += button9.Text;
else{
textBox1.Text =
"0";textBox1.Text += button9.Text;
}
}
private void button1_Click( sender, EventArgs e){
if (p)textBox1.Text += button1.Text;
else{
textBox1.Text =
"0";textBox1.Text += button1.Text;
}
}
private void button2_Click( sender, EventArgs e){
if (p)textBox1.Text += button2.Text;
else{
textBox1.Text =
"0";textBox1.Text += button2.Text;
}
}
private void button3_Click( sender, EventArgs e){
if (p)textBox1.Text += button3.Text;
else{
textBox1.Text =
"0";textBox1.Text += button3.Text;
}
}
private void button5_Click( sender, EventArgs e){
if (p)textBox1.Text += button5.Text;
else{
textBox1.Text =
"0";textBox1.Text += button5.Text;
}
}
private void button6_Click( sender, EventArgs e){
if (p)textBox1.Text += button6.Text;
else{
textBox1.Text =
"0";textBox1.Text += button6.Text;
}
}
private void button7_Click( sender, EventArgs e){
if (p)textBox1.Text += button7.Text;
else{
textBox1.Text =
"0";textBox1.Text += button7.Text;
}
}
private void button10_Click( sender, EventArgs e){
}
private void button11_Click( sender, EventArgs e){
if (p)textBox1.Text += button11.Text;
else{
textBox1.Text =
"0";textBox1.Text += button11.Text;
}
}
private void button13_Click( sender, EventArgs e){
if (p)textBox1.Text += button13.Text;
else{
textBox1.Text =
"0";textBox1.Text += button13.Text;
}
}
private void Form1_Load( sender, EventArgs e){
}
private void button10_Click_1( sender, EventArgs e){
if (p)textBox1.Text += button10.Text;
else{
textBox1.Text =
"0";textBox1.Text += button10.Text;
}
}
private void button1_Click_1( sender, EventArgs e){
if (p)textBox1.Text += button7.Text;
else{
textBox1.Text =
"0";textBox1.Text += button7.Text;
}
}
private void button2_Click_1( sender, EventArgs e){
}
}
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
private void fontToolStripMenuItem_Click( sender, EventArgs e){
if (fontDialog1.ShowDialog() != null )richTextBox1.SelectionFont = fontDialog1.Font;
}
private void bkcolorToolStripMenuItem_Click( sender, EventArgs e){
if (colorDialog1.ShowDialog() != null)richTextBox1.BackColor = colorDialog1.Color;
}
private void textcolorToolStripMenuItem_Click( sender, EventArgs e){
if (colorDialog1.ShowDialog() != null)richTextBox1.SelectionColor = colorDialog1.Color;
}
private void extToolStripMenuItem_Click( sender, EventArgs e){
Application.Exit();}
private void saveToolStripMenuItem_Click( sender, EventArgs e){
if (saveFileDialog1.ShowDialog() != null)richTextBox1.SaveFile(saveFileDialog1.FileName );
}
private void openToolStripMenuItem_Click( sender, EventArgs e){
if (openFileDialog1.ShowDialog() != null)richTextBox1.LoadFile(openFileDialog1.FileName );
}
private void copyToolStripMenuItem_Click( sender, EventArgs e){
richTextBox1.Copy( );
}
private void pastToolStripMenuItem_Click( sender, EventArgs e){
richTextBox1.Paste();
}
private void cutToolStripMenuItem_Click( sender, EventArgs e){
richTextBox1.Cut();
}
private void cutToolStripMenuItem1_Click( sender, EventArgs e){
richTextBox1.Cut();
}
private void copyToolStripMenuItem1_Click( sender, EventArgs e){
richTextBox1.Copy();
}
private void pastToolStripMenuItem1_Click( sender, EventArgs e){
richTextBox1.Paste();
}
private void toolStripButton1_Click( sender, EventArgs e){
if (saveFileDialog1.ShowDialog() != null)richTextBox1.SaveFile(saveFileDialog1.FileName);
}
private void newToolStripMenuItem_Click( sender, EventArgs e){
if (richTextBox1.Text != "") MessageBox.Show("Save File");}
private void Form1_Load( sender, EventArgs e){
}
}
}
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication1{
public partial class Form1 : Form{
()public Form1
{
InitializeComponent():
}
private void Form1_Load( sender, EventArgs e)
{
}
private void Form1_MouseClick( sender, MouseEventArgs e)
{
this.Text = this.Width.ToString() + "***********" + this.Height.ToString();
Random r = new Random();
int x = r.Next(1, 500);
int y = r.Next(1, 700);
button1.Left = x;
button1.Top = y;
button1.Visible = true;
button1.Text = button1.Top.ToString() + "\n" + button1.Left.ToString();
}
private void button1_Click( sender, EventArgs e)
{
button1.Top = Convert.ToInt32(textBox1.Text);
}
private void button2_Click( sender, EventArgs e)
{
button2.Text = button2.Top.ToString()+"\n"+button2.Left.ToString();
}
}
}