學習重點:
主程式:
private void button1_Click(object sender, EventArgs e)
- 宣告變數(variable)
- 按鈕事件(event)
- 彈跳視窗(MessageBox)
主程式:
private void button1_Click(object sender, EventArgs e)
{
int n = 10;
float f = 1.5f;
double d = 3.14;
bool b = true;
string str = "hello"+
n; // n 自動轉型為字串
MessageBox.Show("n
= " + n+", f = "
+ f + ", d = " + d + ", b = " + b + ",
str = " + str);
}
執行結果:
沒有留言:
張貼留言