กรุณาเลือก แสดงผลรูปแบบโทรศัพท์มือถือ | แสดงผลรูแบบคอมพิวเตอร์

Dekcom Board • The Ultimate Knowledge Share

 ลืมรหัสผ่าน
 ลงทะเบียน
ค้นหา
ดู: 492|ตอบ: 0

เฉลยแบบฝึกหัดท้ายบทที่ 5 ข้อที่ 7 [คัดลอกลิงก์]

Rank: 9Rank: 9Rank: 9

Money
144
จิตพิศัย
39
สมัครสมาชิกเมื่อ
2009-12-20
เครดิต
39
โพสต์
42
webmaster โพสต์เมื่อ 2010-8-5 07:50:55 |แสดงโพสต์ทั้งหมด
  1. private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             string user, pwd;
  4.             user = textBox1.Text;
  5.             pwd = textBox2.Text;
  6.             if ((user == "Toey") && (pwd == "1234"))
  7.             {
  8.                 MessageBox.Show("ชื่อผู้ใช้คือ " + user + " รหัสผ่านคือ " + pwd, "แจ้งข้อมูลส่วนตัว", MessageBoxButtons.OK, MessageBoxIcon.Information);
  9.             }else
  10.             {
  11.                 MessageBox.Show("ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง","กรุณาตรวจสอบอีกครั้ง",MessageBoxButtons.OK,MessageBoxIcon.Hand);
  12.             }
  13.         }

  14.         private void button2_Click(object sender, EventArgs e)
  15.         {
  16.             textBox1.Text = "";
  17.             textBox2.Text = "";
  18.         }

  19.         private void textBox1_KeyUp(object sender, KeyEventArgs e)
  20.         {
  21.             if (e.KeyCode == Keys.Enter)
  22.             {
  23.                 textBox2.Focus();
  24.             }
  25.         }

  26.         private void textBox2_KeyUp(object sender, KeyEventArgs e)
  27.         {
  28.             if (e.KeyCode == Keys.Enter)
  29.             {
  30.                 button1.Focus();
  31.             }
  32.         }
คัดลอกไปที่คลิปบอร์ด
ผลรัน
2010-08-05_074259.jpg
2010-08-05_074318.jpg
2010-08-05_074332.jpg

EX5_7.rar

36.56 KB, จำนวนดาวน์โหลด: 18


รับทำเว็บ PHP+MySQL
คุณต้องเข้าสู่ระบบก่อนจึงจะสามารถตอบกลับ เข้าสู่ระบบ | ลงทะเบียน

รูปแบบข้อความล้วน|โทรศัพท์มือถือ|เด็กคอมพ์ชิตี้

GMT+7, 2012-5-21 05:10 , Processed in 0.029615 second(s), 16 queries , Gzip On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc. Page Ranking Tool

ขึ้นไปด้านบน