Junter.wjs STUST MIS 丙 4A990025
Learn More →
public partial class Form1 : Form
{
String keyWorld = "abcdefghijklmnopqrstuvwxyz"; //防止亂數
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
MessageBox.Show("錯誤!請輸入數值", "錯誤!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
else
{
for (int i = 0; i < keyWorld.Length; i++)
{
if (textBox1.Text.Contains(keyWorld.Substring(i, 1)) || textBox1.Text.Contains(keyWorld.ToUpper().Substring(i, 1)))
{
MessageBox.Show("請輸入正確數值", "錯誤!",MessageBoxButtons.OK, MessageBoxIcon.Error);
textBox1.Clear();
return;
}
}
double ct, ft;
ct = Convert.ToDouble(textBox1.Text);
ft = (9.0 * ct) / 5.0 + 32;
textBox2.Text = ft.ToString();
label5.Text = "==>";
button2.Enabled = false;
textBox2.Enabled = false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox2.Text))
{
MessageBox.Show("錯誤!請輸入數值", "錯誤!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
else
{
for (int i = 0; i < keyWorld.Length; i++)
{
if (textBox2.Text.Contains(keyWorld.Substring(i, 1)) || textBox2.Text.Contains(keyWorld.ToUpper().Substring(i, 1)))
{
MessageBox.Show("請輸入正確數值", "錯誤!",MessageBoxButtons.OK, MessageBoxIcon.Error);
textBox2.Clear();
return;
}
}
double ct, ft;
ft = Convert.ToDouble(textBox2.Text);
ct = (5.0 / 9.0) * (ft - 32);
textBox1.Text = ct.ToString();
label5.Text = "<==";
button1.Enabled = false;
textBox1.Enabled = false;
label3.Visible = true;
}
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
label5.Text = "";
textBox1.Enabled = true;
textBox2.Enabled = true;
button1.Enabled = true;
button2.Enabled = true;
textBox1.Focus();
}
private void button4_Click(object sender, EventArgs e)
{
DialogResult Result = MessageBox.Show("您確定要關閉嗎?", "離開確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (Result == DialogResult.OK)
{
MessageBox.Show("謝謝光臨", "哭,你走吧!", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
else if (Result == DialogResult.Cancel)
{
}
}
}
個人資料
經歷:
未來目標:
職業
課業
成就
不知道可以幹嘛的證照:
程式碼如有錯誤!請自行修正。 4a990025@stust.edu.tw
C#
華氏攝氏
溫度
Copyright © 2020 Junter.Inc All Rights Reserved
change h1, h2, h3, h4 and p, strong, ins。`{%hackmd @Junter0323/H14LvIwHu %}`
May 30, 2022:::success 共三層,每層 ≥ 2子classes 每一classes ≥ 1 var + 1 method 用word or pdf 印出 ::: ::: danger
Nov 1, 2021最新公告 :::success 完成作業ㄧ、二 ::: 上課平台 ::: info
Oct 28, 20211.每股盈餘 2.稀釋性 3.母公司淨利 4.本期淨利 5.非控制權益 6.營業利益 7.營業活動之淨現金 (現金流量表) 8.綜合損益 9.流動資產 10.資產總計 (網站)
Apr 20, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up