office Access 2013
打開範例搜尋北風→複製客戶清單到EXCEL→重開Access另存新檔成2000年的mdb檔→檔案存在C槽
Visual Studio
工具箱→ bindingSource1→DataSoure→選擇檔案→DataMenber→選擇資料庫
工具箱→dataGridView1→選擇資料來源→bindingSource1
2015年11月20日 星期五
2015年11月6日 星期五
簡易計算基
public partial class Form1 : Form
{
String aa;
String m;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1 = sender as Button;
textBox1.Text += button1.Text;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button11_Click(object sender, EventArgs e)
{
textBox1.Text = "";
}
private void button10_Click(object sender, EventArgs e)
{
button10 = sender as Button;
textBox1.Text += button10.Text;
}
private void button2_Click(object sender, EventArgs e)
{
button2 = sender as Button;
textBox1.Text += button2.Text;
}
private void button3_Click(object sender, EventArgs e)
{
button3 = sender as Button;
textBox1.Text += button3.Text;
}
private void button4_Click(object sender, EventArgs e)
{
button4 = sender as Button;
textBox1.Text += button4.Text;
}
private void button5_Click(object sender, EventArgs e)
{
button5 = sender as Button;
textBox1.Text += button5.Text;
}
private void button6_Click(object sender, EventArgs e)
{
button6 = sender as Button;
textBox1.Text += button6.Text;
}
private void button7_Click(object sender, EventArgs e)
{
button7 = sender as Button;
textBox1.Text += button7.Text;
}
private void button8_Click(object sender, EventArgs e)
{
button8 = sender as Button;
textBox1.Text += button8.Text;
}
private void button9_Click(object sender, EventArgs e)
{
button9 = sender as Button;
textBox1.Text += button9.Text;
}
private void button19_Click(object sender, EventArgs e)
{
if (aa == null)
return;
Double a = Double.Parse(aa);
Double b = float.Parse(textBox1.Text);
Double d = float.Parse(textBox1.Text);
Double c = 0;
switch (m)
{
case "+":
c = a + b;
break;
case "-":
c = a - b;
break;
case "*":
c = a * b;
break;
case "/":
c = a / d;
break;
}
textBox1.Text = c.ToString();
if (d == 0) textBox1.Text = "除數不為零";
}
private void button12_Click(object sender, EventArgs e)
{
button12 = sender as Button;
m = button12.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button13_Click(object sender, EventArgs e)
{
button13 = sender as Button;
m = button13.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button14_Click(object sender, EventArgs e)
{
button14 = sender as Button;
m = button14.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button15_Click(object sender, EventArgs e)
{
button15 = sender as Button;
m = button15.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button17_Click(object sender, EventArgs e)
{
button17 = sender as Button;
m = button17.Text;
aa = textBox1.Text;
textBox1.Text = "";
Double a = Double.Parse(aa);
Double c = 0;
c = Math.Sqrt(a);
textBox1.Text = c.ToString();
}
private void button18_Click(object sender, EventArgs e)
{
button18 = sender as Button;
m = button18.Text;
aa = textBox1.Text;
textBox1.Text = "";
Double a = Double.Parse(aa);
Double c = 0;
c =1/a;
textBox1.Text = c.ToString();
if (a == 0) textBox1.Text = "除數不為零";
}
private void button20_Click(object sender, EventArgs e)
{
button20 = sender as Button;
textBox1.Text += button20.Text;
}
private void button16_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length > 0)
{
textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);
}
}
}
{
String aa;
String m;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1 = sender as Button;
textBox1.Text += button1.Text;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button11_Click(object sender, EventArgs e)
{
textBox1.Text = "";
}
private void button10_Click(object sender, EventArgs e)
{
button10 = sender as Button;
textBox1.Text += button10.Text;
}
private void button2_Click(object sender, EventArgs e)
{
button2 = sender as Button;
textBox1.Text += button2.Text;
}
private void button3_Click(object sender, EventArgs e)
{
button3 = sender as Button;
textBox1.Text += button3.Text;
}
private void button4_Click(object sender, EventArgs e)
{
button4 = sender as Button;
textBox1.Text += button4.Text;
}
private void button5_Click(object sender, EventArgs e)
{
button5 = sender as Button;
textBox1.Text += button5.Text;
}
private void button6_Click(object sender, EventArgs e)
{
button6 = sender as Button;
textBox1.Text += button6.Text;
}
private void button7_Click(object sender, EventArgs e)
{
button7 = sender as Button;
textBox1.Text += button7.Text;
}
private void button8_Click(object sender, EventArgs e)
{
button8 = sender as Button;
textBox1.Text += button8.Text;
}
private void button9_Click(object sender, EventArgs e)
{
button9 = sender as Button;
textBox1.Text += button9.Text;
}
private void button19_Click(object sender, EventArgs e)
{
if (aa == null)
return;
Double a = Double.Parse(aa);
Double b = float.Parse(textBox1.Text);
Double d = float.Parse(textBox1.Text);
Double c = 0;
switch (m)
{
case "+":
c = a + b;
break;
case "-":
c = a - b;
break;
case "*":
c = a * b;
break;
case "/":
c = a / d;
break;
}
textBox1.Text = c.ToString();
if (d == 0) textBox1.Text = "除數不為零";
}
private void button12_Click(object sender, EventArgs e)
{
button12 = sender as Button;
m = button12.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button13_Click(object sender, EventArgs e)
{
button13 = sender as Button;
m = button13.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button14_Click(object sender, EventArgs e)
{
button14 = sender as Button;
m = button14.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button15_Click(object sender, EventArgs e)
{
button15 = sender as Button;
m = button15.Text;
aa = textBox1.Text;
textBox1.Text = "";
}
private void button17_Click(object sender, EventArgs e)
{
button17 = sender as Button;
m = button17.Text;
aa = textBox1.Text;
textBox1.Text = "";
Double a = Double.Parse(aa);
Double c = 0;
c = Math.Sqrt(a);
textBox1.Text = c.ToString();
}
private void button18_Click(object sender, EventArgs e)
{
button18 = sender as Button;
m = button18.Text;
aa = textBox1.Text;
textBox1.Text = "";
Double a = Double.Parse(aa);
Double c = 0;
c =1/a;
textBox1.Text = c.ToString();
if (a == 0) textBox1.Text = "除數不為零";
}
private void button20_Click(object sender, EventArgs e)
{
button20 = sender as Button;
textBox1.Text += button20.Text;
}
private void button16_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length > 0)
{
textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);
}
}
}
2015年11月5日 星期四
計算機(+-*/)
public partial class Form1 : Form
{
int x, y,c=0;
float a, b,d;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x + y;
label2 .Text=c.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x - y;
label2.Text = c.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x * y;
label2.Text = c.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox1.Text);
a = float.Parse(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
b = float.Parse(textBox2.Text);
d = a / b;
label2.Text = d.ToString();
if (b == 0) label2.Text = "除數不為零";
}
}
}
{
int x, y,c=0;
float a, b,d;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x + y;
label2 .Text=c.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x - y;
label2.Text = c.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
x = Convert.ToInt32(textBox1.Text);
x = int.Parse(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
y = int.Parse(textBox2.Text);
c = x * y;
label2.Text = c.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox1.Text);
a = float.Parse(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
b = float.Parse(textBox2.Text);
d = a / b;
label2.Text = d.ToString();
if (b == 0) label2.Text = "除數不為零";
}
}
}
第二節課(螢幕保護程式)
需要一個button,一個timer
public partial class Form1 : Form
{
int x, y, a = 0, b = 0, c = 0, d = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
button1.Text = "";
}
private void timer1_Tick(object sender, EventArgs e)
{
x = a;
if (a >= 650) b = 1;
if (a <= 0) b = 0;
if (b == 1)
{
a = a - 50;
}
else
{
a = a + 50;
}
y = c;
if (c >= 300) d = 1;
if (c <= 0) d = 0;
if (d == 1)
{
c = c - 50;
}
else
{
c = c + 50;
}
button1.Location = new Point(x, y);
}
}
public partial class Form1 : Form
{
int x, y, a = 0, b = 0, c = 0, d = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
button1.Text = "";
}
private void timer1_Tick(object sender, EventArgs e)
{
x = a;
if (a >= 650) b = 1;
if (a <= 0) b = 0;
if (b == 1)
{
a = a - 50;
}
else
{
a = a + 50;
}
y = c;
if (c >= 300) d = 1;
if (c <= 0) d = 0;
if (d == 1)
{
c = c - 50;
}
else
{
c = c + 50;
}
button1.Location = new Point(x, y);
}
}
第一節課 (按鈕移動)
需要一個button
public partial class Form1 : Form
{
int x, y, c = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c = c + 50;
x = c;
y = 50;
button1.Location = new Point(x, y);
button1.Text = x.ToString();
}
}
}
public partial class Form1 : Form
{
int x, y, c = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c = c + 50;
x = c;
y = 50;
button1.Location = new Point(x, y);
button1.Text = x.ToString();
}
}
}
訂閱:
文章 (Atom)