PIXNET Logo登入

程式設計的部落格 應用數學系 陳易辰

跳到主文

歡迎光臨 程式設計工藝大師 http://tccnchsu.blogspot.tw/

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 12月 05 週五 201414:55
  • excel 隨機產生變色變數

excel 隨機產生變色變數
錄製巨集方法:從Excel的檢視 ---> 巨集 ---> 錄製巨集編輯程式
 
 
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(26)

  • 個人分類:
▲top
  • 11月 28 週五 201415:28
  • C# 製作9個按鈕與點擊產生對話框程式碼

C# 製作9個按鈕與點擊產生對話框程式碼
 
 
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
}
private void judge()
{
MessageBox.Show("文字");
}
private void button1_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button2_Click_1(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}
private void button3_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button3_Click_1(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");

}

private void button4_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button5_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button6_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button7_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button8_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

private void button9_Click(object sender, EventArgs e)
{
judge();
MessageBox.Show("文字");
}

}
}
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(128)

  • 個人分類:
▲top
  • 11月 14 週五 201415:32
  • 圈叉遊戲

圈叉遊戲
 
 
private void Form1_Load(object sender, EventArgs e)
{
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:
▲top
  • 11月 13 週四 201415:16
  • 簡易型計算機 程式碼

簡易型計算機 程式碼
 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(1,350)

  • 個人分類:
▲top
  • 11月 12 週三 201415:12
  • 骰子競走

骰子競走
 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace WindowsFormsApplication1
{
   public partial class Form1 : Form
   {
       int ssum1 = 0;
       int ssum2 = 0;
       public Form1()
       {
           InitializeComponent();
       }

       private void button1_Click(object sender, EventArgs e)
       {
           int d1, d2 , dsum;
           Random irand = new Random();
           d1 = irand.Next(1, 7);
           d2 = irand.Next(1, 7);
           label1.Text=Convert.ToString(d1);
           label2.Text=Convert.ToString(d2);
           dsum = d1 + d2;
           for (int i = 1; i <= dsum; i++)
           {
               button2.Left = (i+ssum1)*5;
               Thread.Sleep(100); // Delay 0.1秒
               Application.DoEvents();
           }
           ssum1 = ssum1 + dsum;
           textBox1.Text = Convert.ToString(ssum1);
           if (button2.Left >= 100)
               MessageBox.Show("2 win");

       }

       private void button3_Click(object sender, EventArgs e)
       {
           int d1, d2, dsum;
           Random irand = new Random();
           d1 = irand.Next(1, 7);
           d2 = irand.Next(1, 7);
           label1.Text = Convert.ToString(d1);
           label2.Text = Convert.ToString(d2);
           dsum = d1 + d2;
           for (int i = 1; i <= dsum; i++)
           {
               button4.Left = (i + ssum2) * 5;
               Thread.Sleep(100); // Delay 0.1秒
               Application.DoEvents();
           }
           ssum2 = ssum2 + dsum;
           textBox2.Text = Convert.ToString(ssum2);
           if (button4.Left >= 100)
               MessageBox.Show("4 win");

       }
   }
}
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:
▲top
  • 11月 07 週五 201415:36
  • 紅綠燈

紅綠燈
 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
int c, r;

public Form1()
{
InitializeComponent();
c = 0;
}

private void button4_Click(object sender, EventArgs e)
{
c = c + 1;
r = c % 3;

if (r == 0)
{
button1.BackColor = Color.Red;
button2.BackColor = Color.White;
button3.BackColor = Color.White;
}
else if (r == 1)
{
button1.BackColor = Color.White;
button2.BackColor = Color.Yellow;
button3.BackColor = Color.White;
}
else
{
button1.BackColor = Color.White;
button2.BackColor = Color.White;
button3.BackColor = Color.Green;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
c = c + 1;
r = c % 3;

if (r == 0)
{
button1.BackColor = Color.Red;
button2.BackColor = Color.White;
button3.BackColor = Color.White;
}
else if (r == 1)
{
button1.BackColor = Color.White;
button2.BackColor = Color.Yellow;
button3.BackColor = Color.White;
}
else
{
button1.BackColor = Color.White;
button2.BackColor = Color.White;
button3.BackColor = Color.Green;
}
}
}
}
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(48)

  • 個人分類:
▲top
  • 11月 05 週三 201415:30
  • 99乘法表與開啟c#

99乘法表
 開啟程式:開啟microsoft visual studio 2010 ->新增專案->Visual c# windows form 應用程式->修改檔名與位置->確認
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Button[,] buttons = new Button[9, 9];
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
// Instantiating all the buttons in the array
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
{
buttons[i, j] = new Button();
buttons[i, j].Location = new Point(i * 50, j * 50);
buttons[i, j].Size = new Size(50, 50);
this.Controls.Add(buttons[i, j]);
}
}

}
}
(繼續閱讀...)
文章標籤

ryan30721 發表在 痞客邦 留言(0) 人氣(278)

  • 個人分類:
▲top
«12

個人資訊

ryan30721
暱稱:
ryan30721
分類:
不設分類
好友:
累積中
地區:

熱門文章

  • (128)C# 製作9個按鈕與點擊產生對話框程式碼
  • (2)圈叉遊戲
  • (48)紅綠燈
  • (26)excel 隨機產生變色變數
  • (2)陣列
  • (0)骰子競走
  • (1,350)簡易型計算機 程式碼
  • (278)99乘法表與開啟c#
  • (109)產生不重複亂數 0-15
  • (25)java學習動機

文章分類

  • 未分類文章 (1)

最新文章

  • HelloAppInventor 簡易手機APP--- App Inventor
  • 數字推盤
  • 4x4 按鈕
  • 多個按鈕4/10
  • 1 to 10
  • java-按鈕
  • java第一堂 修改路徑
  • java學習動機
  • 產生不重複亂數 0-15
  • 陣列

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: