วันอังคารที่ 16 กรกฎาคม พ.ศ. 2556

InternetConnect

InternetConnect

Sometimes the problems caused by unintentional human errors
บางทีนะ  ปัญหาก็เกิดจากความผิดพลาดที่ไม่เจตนาของคนเราเองนี่แหละ

Sometimes Internet connection problem can be our frustration. Rather than pressing F5-key and  trying to reload the website when we experience a problem, here are some ways we can troubleshoot the problem and identify the cause.
 างครั้ง ปัญหาการเชื่อมต่ออินเทอร์เน็ตอาจกลายเป็นเรื่องความคับข้องใจเราได้เหมือน กัน  การกดแป้น F5 และการโหลดเว็บไซต์ใหม่ ก็อาจจะไม่เพียงพอ  แต่ถ้าเราพอจะมีประสบการณ์ในการแก้ปัญหาอยู่บ้าง ปัญหานี้ก็อาจจะคลี่คลายลงได้

Ensure we check the physical connections before getting too involved with troubleshooting. Anyone could have accidentally kicked the router or modem’s power cable or pulled an Ethernet cable out of a socket, causing the problem.
ก่อนอื่น เราต้องแน่ใจก่อนนะว่า กายภาพของการเชื่อมต่อ (the physical connections) ได้แก่ อุปกรณ์ สายสัญญาณ จุดเชื่อมต่อต่างๆ จักต้องอยู่ในสภาพปกติ ไม่มีใครไปสะดุดสายจนหลุด หรือดึงสายต่างๆ ออก

#    #     #  

Ping


Ping  (wikipedia.org) is a computer network administration utility used to test the reach-ability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer.
ping เป็นคำสั่งที่ใช้บริหารจัดการ (administration utility) ระบบเครือข่ายคอมพิวเตอร์ ใช้เพื่อตรวจสอบการเข้าถึงเครื่องคอมพิวเตอร์ที่มีตัวตนจริงหรือโฮสต์ (host) ของเครือข่ายที่ใช้อินเทอร์เน็ตโปรโตคอล  เพื่อจะวัดเวลาของการสื่อสารไป-กลับ ระหว่างคอมพิวเตอร์ต้นทางและปลายทาง

The name comes from active sonar terminology which sends a pulse of sound and listens for the echo to detect objects underwater. 
ชื่อนี้มีที่มาจากโซนาร์ sonar terminology ที่เรือดำน้ำใช้ส่งให้ไปกระทบวัตถุใต้น้ำ แล้วสะท้อนกลับมานั่นเอง

One of the first things to try when our connection doesn’t seem to be working properly is the ping command. Open a Command Prompt window from your "Start button" using the "cmd" command  and type a command like ping google.com .  
 สิ่งแรกที่เราควรทำ เมื่อการเชื่อมต่ออินเทอร์เน็ตของเราไม่เวิร์ก ก็คือ การใช้คำสั่ง ping โดยอาจจะเปิดหน้าต่าง command prompt ด้วยคำสั่ง cmd ณ Start Button แล้วพิมพ์คำสั่ง เช่น ping google.com .  

This command sends several packets to the address you specify. 
We can see that everything is working fine.
There’s 0% packet loss and the time each packet takes is fairly low.  

คำสั่ง ping จะส่ง packets (ข้อมูลในหน่วยวินาที) ไปยังเครื่องที่เป็นโฮสต์ปลายทาง 
จากภาพ จะเห็นว่า คำสั่งทำงานได้ดี  ไม่มีการสูญเสีย packet เลย  คือ ส่งไป 4 ได้คืน 4
และใช้เวลาน้อย 13-25 (เฉลี่ย 18) มิลลิวินาที 


  #    #     #

Modem & Router Issues

 Sometimes our modems or routers can cause the problem of Internet connection. A modem is a device that communicates with your Internet service provider (ISP), e.g. TOT, while the router shares the connection among all the computers and other networked devices in our home network. In my case (and also other students' cases ) , the modem and the router of mine is the same device, so it is called the "modem-router".
 างครั้ง Modem หรือ Router ก็อาจจะเป็นปัญหาการเชื่อมต่ออินเทอร์เน็ตของเราก็ได้  
Modem เป็นเครื่องมือในการสื่อสารกับผู้ให้บริการอินเทอร์เน็ต (Internet service provider : ISP)  อาทิ  TOT   สำหรับ Router เป็นอุปกรณ์ที่ทำหน้าที่แชร์การเชื่อมต่อระหว่างคอมพิวเตอร์และอุปกรณ์ต่างๆ ในระบบโฮมเน็ตเวิร์ก  กรณีของบ้านครูเอง (และบ้านนักเรียนกาญจนาฯ หลายคน) อุปกรณ์สองอย่างนี้จะเป็นตัวเดียวกัน มันเลยถูกเรียกว่า "modem-router"

 Let's take a look at the modem-router. If green lights are flashing on it, that’s normal and indicates network traffic. If we see a steady, blinking orange light, that generally indicates the problem. 
องดูสิว่า  modem-router ของบ้านเรา  มันมีไฟสัญญาณเป็นสีเขียวนิ่งๆ หรือเปล่า? ถ้าใช่ ก็แสดงว่า เครือข่ายโฮมเน็ตเวิร์กบ้านเราทำงานเป็นปกติดีไม่มีปัญหา  แต่ถ้าเราเห็นไฟสัญญาณเป็นสีอำพันกระพริบๆ ก็หมายความว่า โฮมเน็ตเวิร์กมีปัญหาแล้ว

 
All Green Lights Mean Normality
สัญญาณไฟเขียวตลอดแบบนี้ แสดงว่า ทุกอย่างปกติดี


If the lights indicate that either devices are experiencing a problem, try unplugging them and plugging them back in. This is just like restarting our computer. If we still experience problems, we may need to perform a factory reset on your router (to see its manual)
 ากไฟสัญญาณของ modem-router แสดงว่า มีปัญหา  ขอให้เราลองดึงปลั๊กไฟของมันออก แล้วเสียบกลับเข้าไปใหม่  ทำแบบนี้ก็ทำนองเดียวกับการที่เรา Restart คอมพิวเตอร์ใหม่นั่นแหละ  หากทำแล้วยังมีปัญหาอยู่  เราก็อาจจะต้องทำการรีเซ็ตอุปกรณ์นี้ใหม่ (ดูคู่มือก่อน) ให้กลับไปเป็นค่าที่ตั้งมาจากโรงงาน


#    #     #

Our Classroom102

What is about the problem when we are in the classroom? Because the IPaddress conflict can be occurred  anytime, so any computer in the classroom102 can be kicked off easily by the gateway computer of the Media Center which we have to lean on.
ปัญหาการเชื่อมต่ออินเทอร์เน็ตในห้องเรียนเป็นแบบไหน? ก็เพราะปัญหารหัสไอพีของเครื่องขัดแย้งกัน (IPaddress conflict) สามารถเกิดขึ้นได้ตลอดเวลา  ดังนั้นคอมพิวเตอร์ในห้องเรียน102 ก็มีสิทธิ์จะถูกดีดออกนอกระบบได้ไม่ยากจากเครื่องเกตเวย์ของศูนย์สื่อที่เรา ต้องพึ่งพาในการเชื่อมต่ออินเทอร์เน็ตนั่นเอง
  
Yes, we cannot connect to the Net directly but always request Internet sharing with the server computer of School Media Center through the local area network.
ใช่เลย  เราไม่ และไม่อาจเชื่อมต่ออินเทอร์เน็ตโดยตรงได้ นอกจากต้องพึ่งพาเครื่องคอมพิวเตอร์แม่ข่ายของศูนย์สื่อของโรงเรียน  (the server computer of School Media Center)  ผ่านระบบเครือข่ายแลน

There are variety kinds of computer in the classroom102, both old and new, big-name and no-name, useable and unusable 
คอมพิวเตอร์ในห้องเรียน 102 มีหลายจำพวก ทั้งเก่าทั้งใหม่  ทั้งมียี่ห้อและไม่มียี่ห้อ  ที่ใช้ได้ก็มี ที่ใช้ไม่ได้ก็มี


Because any student can log on any computer in our classroom with the administrative account, so he has the full permissions to change/config anything about the network, then any problem can be occurred anytime.
เป็น เพราะนักเรียนสามารถจะล็อกออนเข้าใช้งานคอมพิวเตอร์ด้วยแอ็คเคาท์ของผู้ดู และระบบของเครื่องคอมพิวเตอร์นั้นๆ (the administrative account)  ก็เลยมีสิทธิ์เต็มร้อยที่จะเข้าไปปรับค่าต่างๆ ของระบบเครือข่ายของเครื่อง  ปัญหาก็อาจจะเกิดขึ้นได้ตลอดเวลา

Folder and Printer Sharing การแชร์โฟลเดอร์/เครื่องพิมพ์

Folder and Printer Sharing การแชร์โฟลเดอร์/เครื่องพิมพ์



The Atmosphere of My 2003 Computer Class at 4th Floor of Building1.
They were energetic and very nice schoolkids I have ever experienced.

บรรยากาศห้องเรียนคอมพิวเตอร์  2546 สมัยยังอยู่ชั้น 4  อาคาร 1 
พวกเขาเป็นเด็กนักเรียนที่ขยันขันแข็ง ตั้งใจเรียน และเป็นเด็กดีมากที่สุดรุ่นหนึ่งเท่าที่ครูเคยเจอ
All of us use Windows7 as the operating software, and our computers are connected together within the workgroup of the LAN (local area network). So we should gain the benefit of its sharing capability. Here we go!
ตอนนี้พวกเราล้วนแล้วแต่ใช้ Windows7 เป็นซอฟต์แวร์ระบบปฏิบัติการ (ในห้องเรียน และที่บ้านด้วย)  และเครื่องของพวกเราก็เชื่อมต่อกันเป็นเวิร์กกรุ๊ปในระบบแลน  ดังนั้นเราก็น่าจะใช้ความสามารถในการแชร์ทรัพยากรระหว่างกันได้  ลองดูกัน

1. FOLDER SHARING
        การแชร์โฟลเดอร์

Be sure we have to specify what folder that we want to share?  
ต้องระบุโฟลเดอร์ที่ต้องการแชร์



"BOOKS" is the folder of us to be shared.
ฟลเดอร์ "BOOKS" คือโฟลเดอร์ที่เราอยากแชร์

 Make a right clicking with the folder, the dialogue box appears. Select the "Sharing" tab and the "Advanced Sharing" button
คลิกขวาที่โฟลเดอร์  กรอบโต้ตอบจะปรากฏขึ้น  เราก็เลือกแท็บ 
"Sharing" และปุ่ม 
"Advanced Sharing"


Now the folder has never been shared yet (Not Shared)
ตอนนี้โฟลเดอร์นี้มีสถานภาพไม่ได้ถูกแชร์ไว้

 Properties window of the folder appears and we should select to share it with others. Now we can see the maximum number of users to simultaneously enter to the folder is 20. Then we can click on the "Permission" button.
จะ ปรากฏหน้าต่างพรอพเพอร์ตีส์ (คุณสมบัติ) ของโฟลเดอร์นี้ขึ้นมา  และเราก็ต้องเลือกว่าจะแชร์กัน  และจะเห็นว่า เพื่อนๆ จะเชื่อมต่อเข้ามาใช้โฟลเดอร์ของเราพร้อมกันได้เต็มที่ 20 เครื่อง แค่นั้น  ต่อมาก็เลือกคลิกปุ่ม "Permission"

Tick the check-box, and we can change the share name or ignore it.
ติ๊กเลือกว่าจะแชร์  จะเปลี่ยน/หรือไม่เปลี่ยนชื่อที่จะแชร์ก็ได้

After clicking on the permission button, the Permissions window shows up, you can add any user e.g. "student" and you can change the permission type of the user.
หลังจากคลิกปุ่ม permission  จะมีหน้าต่างโผล่มาให้เราปรับเปลี่ยนตามความต้องการ

We can add user/ specify his permission level.
เราสามารถเพิ่มยูสเซอร์ / ระบุระดับการอนุญาตใช้งานโฟลเดอร์ของเราแก่เขา

Finally click on the "Apply" button, the folder now has been shared. 
เมื่อเราคลิกปุ่ม "Apply" โฟลเดอร์ของเราก็ได้รับการแบ่งปันให้ใช้ร่วมกันได้ในเครือข่ายแล้ว

Well, our folder has been shared.
Folder ของเราได้รับการแชร์กันใช้เรียบร้อยแล้ว

Sample Special
ตัวอย่าง


This is from my computer (Its hostname is "ALPHA00".), when I click on the "Network" (at the left pane of Windows7 "Computer explorer" )  some computer hostnames appears.  Yes, I want to randomly select any hostname. If the target of mine is "KACHATUCH", yes I would make a double-click on it.
นี่ เป็นคอมพิวเตอร์ของครูที่ห้องพักครู (โฮสต์เนมว่า ALPHA00)  เมื่อครูคลิกเลือก Network (อยู่ตรงแถบซ้ายของหน้าต่าง Computer explorer ของ Windows7 ก็จะปรากฏโฮสต์เนมต่างๆ ในเครือข่าย  แน่นอนว่า ครูก็คงต้องสุ่มเลือกเข้าไปใช้เครื่องใดสักเครื่อง  ที่ครูเล็งไว้ก็คือเครื่องที่มีโฮสต์เนมว่า Kachatuch

My Target Hostname is "KACHATUCH"
เครื่องที่ครูเล็งไว้คือ โฮสต์เนมที่ชื่อว่า Kachatuch

The shared folders of the hostname will be appeared. Then we can do a random selection and we can find any other subfolders that we can select to use.
ตอน นี้ก็จะเห็นโฟลเดอร์ที่โฮสต์เนม Kachatuch  เราก็คงต้องสุ่มเลือกโฟลเดอร์  แล้วเราก็จะเห็นโฟลเดอร์ย่อยๆ ที่เราสามารถจะเลือกเข้าไปใช้ได้ 

The Shared Folders of "Kachatuch" appears, any folder could be selected.
  If any shared folder had been selected its subfolders would be revealed. 

แชร์โฟลเดอร์ของโฮสต์เนม "Kachatuch" ก็จะปรากฏขึ้นมาให้เห็น เราสามารถเลือกโฟลเดอร์ไดก็ได้
ถ้าแชร์โฟลเดอร์ใดถูกเลือกเข้าใช้ โฟลเดอร์ย่อยๆ ก็จะได้รับการเปิดตัวออกมาให้เห็นฝเลือกใช้ได้



 2. PRINTER SHARING
        การแชร์พรินเตอร์


 Click the "Start button" of Windows7 desktop, the pop-up menu appears, then select "Devices and Printers", the target printer of us will be appeared.
จากปุ่ม Start ของ Windows7 เราก็เลือก "Devices and Printers"  ก็จะเจอพรินเตอร์ที่เราอยากจะแชร์กันใช้

Select the printer

 Make a right click on the printer icon, the select menu will show up, then select "Printers properties" option.  Then we can operate sharing easily.
คลิ กขวาที่รูปพรินเตอร์ จะมีป็อปอัพเมนูโผล่ขึ้นมา ให้เราเลือก "Printers properties" ต่อจากนี้ เราก็คงจะปฏิบัติการแชร์พรินเตอร์ได้ไม่ยากแล้ว...

Select : Printer Properties

Click on the "Sharing tab", and we can rename the sharing printer.
เลือกแท็บ Sharing และสามารถเปลี่ยนชื่อพรินเตอร์ที่กำลังจะแชร์ได้ด้วย

Select the Sharing Tab
   
Select to share

Links's Blogger

Links's Blogger

ด.ช.กฤษฎา แย้มทรัพย์
 http://www.07148ky.blogspot.com/ 
ด.ช.ชนนน พรพิพัฒน์พงศ์
http://www.7149ch.blogspot.com/2013/06/about-me.html
ด.ช. 
ณฐวัฒน์ นามแสง
http://www.07150nn.blogspot.com/
ด.ช. เทพนรินทร์ คุ้มภัย
http://www.07151thk.blogspot.com/
ด.ช. ธีร์รัชช์ สุขสมพงษ์
http://www.07152ts.blogspot.com/
ด.ช. 
พิษณุวัฒน์ มาตรศรี
http://www.pmf07153.blogspot.com/
ด.ช. ภัคพล สาระสันต์

http://www.07154ps.blogspot.com/
ด.ช. ภู
ริณัฐ อรุณโชติ
http://www.07155p.blogspot.com/
ด.ช. ศักดิ์ชัย ชื่นชูลักษณ์

http://www.07156sc.blogspot.com/
ด.ช. ศักดิ์ณรงค์ สมบัติเจริญ

http://www.07157ss.blogspot.com/
ด.ช. สร
วิชญ์ พันธุ์เสือ
http://www.07158sp.blogspot.com/
ด.ช. 
อภิวัฒน์ สุวรรณศรี
http://www.07159a.blogspot.com/
ด.ช. อัคร
รัชต์   พิมใจใส
http://07161ta.blogspot.com/
ด.ช. อัศวิน วารีนิล

http://www.7161av.blogspot.com/
ด.ญ. กนกวรรณ จันทร์เพ็ญ
http://www.7162kjn.blogspot.com/
ด.ญ. กฤติกา ทองคำใส

http://www.07163jkt.blogspot.com/
ด.ญ. แก้วกานต์ จึงรักเสรีชัย

http://www.07164kj.blogspot.com/
ด.ญ. ขวัญฤดี มงคลไพบูลย์

http://www.07165ykm.blogspot.com/
ด.ญ. 
ชนิษฐา พลายละหาร
http://www.7166ncp.blogspot.com/
ด.ญ. ชลธิดา ทองสุข

http://www.7167chonthida.blogspot.com/
ด.ญ. ชิดชนก เรืองขจร

http://www.7168chitchanok.blogspot.com/
ด.ญ. 
ฌาณิการ์ นุชบูรณ์
http://www.7169chanika.blogspot.com/
ด.ญ. 
ฑิฆัมพร นิลเขตร
http://www.7170tn.blogspot.com/
ด.ญ. 
ณัฐกฤตา เครือใจวัง
http://www.7171nkf.blogspot.com/
ด.ญ. 
ณัฐกฤตา เสร็จกิจ
http://www.7172nsp.blogspot.com/ด.ญ. ทิพานัน   วรเวชวงศ์
http://www.07173ftw.blogspot.com/
ด.ญ. ธัญมน ทัศนสุวรรณ
http://www.7174tanyamon.blogspot.com/
ด.ญ. นิ
มนญา ปาลพันธ์
http://www.7175enp.blogspot.com/
ด.ญ. 
นูรีน กิจจำนง
http://www.7176nk.blogspot.com/
ด.ญ. เบญจ
วรรณ   ศิริรักษ์
http://www.7177bs.blogspot.com/
ด.ญ. ปรียาภัทร เรือนรื่น

http://www.7178prf.blogspot.com/
ด.ญ. ปา
รีณา บัวบาน
http://www.7179pareena.blogspot.com/
ด.ญ. พลอยพรรณ 
จุมพรม
www.07180cpj.blogspot.com
ด.ญ. 
พัชร์ปรียา สุทธิประภา
http://www.07181pp.blogspot.com/
ด.ญ. มิ่งขวัญ ศรี
สมโภชน์
http://www.7182msa.blogspot.com/
ด.ญ. 
วรารัตน์ เคนผาพงษ์
http://www.07183mwk.blogspot.com/
ด.ญ. วันวิสา 
ฉิมภาลี
http://www.07184wcg.blogspot.com/ด.ญ. ศศิวิมล ชำนาญดี
http://www.7185sc.blogspot.com/
ด.ญ. 
สโรชา สืบจากสิงห์
http://www.7186ss.blogspot.com/
ด.ญ. สตรีรัตน์ ทิพย์ป่า
เว
http://www.07187stn.blogspot.com/
ด.ญ. 
สุนันทา ชีพนุรัตน์
http://www.07188sc.blogspot.com/
ด.ญ. สุ
ภัชญา แซ่จันทร์
http://www.07189ssp.blogspot.com/
ด.ญ. สุภัสสร เรือนวิลัย

http://www.07190sr.blogspot.com/
ด.ญ. 
อภิชญา   ธัญญะผล
http://www.7191at.blogspot.com/
ด.ญ. 
รฐาภ์ วงษ์เวียงจันทร์
http://www.7192rwa.blogspot.com/
ด.ญ. 
ชลธิชา พูลสวัสดิ์
http://www.07216cp.blogspot.com/

Programming (การโปรแกรม) with Visual Basic 6.0

Programming (การโปรแกรม) with Visual Basic 6.0



WHAT IS VISUAL BASIC?
วิชวลเบสิกคืออะไร


Visual Basic is a tool that allows us to develop Windows (Graphic User Interface - GUI) applications.  The applications have a familiar appearance to the user.
วิชวลเบสิก เป็นเครื่องมือของเราในการสร้างแอ็ปปลิเคชัน (โปรแกรมประยุกต์) ที่ทำงานภายใต้ระบบปฏิบัติการ Windows ซึ่งแอ็ปปลิเคชันที่ได้จะมีรูปแบบการติดต่อกับผู้ใช้เป็นกราฟิก (GUI : Graphic User Interface)
 
 Visual Basic is event-driven, meaning code remains idle until it is called upon to respond to some event (e.g. mouse clicking, button pressing, menu selection, ...).  Nothing happens until an event is detected.  Once an event is detected, the code corresponding to that event (event procedure) is executed.  
 
วิ ชวลเบสิก จะใช้ Event (เหตุการณ์) เป็นตัวขับเคลื่อนคำสั่ง (event-driven)  หมายความว่า โค้ดของโปรแกรม จะยังไม่ทำอะไร (idle) จนกว่ามันจะถูกเรียกให้ตอบสนองต่อ event  (เช่น การคลิกเมาส์  การกดปุ่ม  การเลือกเมนู  ฯลฯ)  นั่นคือ จะไม่มีอะไรเกิดขึ้นจนกว่า event จะถูกตรวจพบ  เมื่อนั้นแหละ code ของโปรแกรมก็จะตอบสนองต่อ event นั้นๆ  ในลักษณะของโปรแกรมย่อยๆ หรือโมดุล (event procedure)
 

 HOW TO PROGRAM WITH VISUAL BASIC?
จะโปรแกรมด้วยวิชวลเบสิกอย่างไร
 
 

Steps in Developing Application 
ขั้นตอนการพัฒนาแอ็ปปลิเคชัน

There are three primary steps involved in building a Visual Basic application:
มีขั้นตอนหลักๆ 3 ขั้นตอน ที่เกี่ยวข้องกับการสร้างแอ็ปปลิเคชันด้วยวิชวลเบสิก
1.    Draw the user interface  ออกแบบส่วนติดต่อกับผู้ใช้
2.    Assign properties to controls  กำหนดคุณสมบัติให้กับคอนโทรล
3.    Attach code to controls  ผูกติด code เข้ากับคอนโทรล


STOP WATCH APPLICATION
โปรแกรมจับเวลา


1 At the "Start-up Menu" of our Windows Desktop, let's find where "Microsoft Visual Studio 6.0" is, and click on it. Then we can see some shortcuts to the applications of the software suite, and "Microsoft Visual Basic6.0" is one of them and it is also our "target software" right now, let's select it.
ณ  สตาร์ทอัพเมนู ที่หน้าเดสต์ท็อปของระบบวินโดวส์  นักเรียนลองหาเมนู Microsoft Visual Studio 6.0  และคลิกเมาส์เลือก  เรา จะเห็นช็อตคัตของแอปปลิเคชันต่างๆ ที่รวมกันอยู่ในซอฟต์แวร์ชุดนี้ รวมถึง Microsoft Visual Basic6.0 ซึ่งเป็นซอฟต์แวร์เป้าหมายที่เราจะใช้ในงานนี้แหละ  เราก็เลือกซะนะ

At the "Start-up Menu of Windows", Find where the "Microsoft Visual Basic 6.0" is.
ณ สตาร์ทอัพเมนูของระบบวินโวส์  ให้หาว่า Microsoft Visual Basic 6.0 อยู่ไหน






2 We now at the main screen of Visual Basic 6.0 with its "New Project" window. Let's click on the "New" tab and select "Standard EXE" icon.
 ตอน นี้เราก็มาอยู่ ณ หน้าจอหลักของ Visual Basic 6.0 ซึ่งมีหน้าต่าง New Project โชว์อยู่  ให้เราเลือกแท็บ New และสัญรูป Standard EXE 
Select the "Standard EXE" icon  ให้นักเรียนเลือกสัญรูป Standard EXE

3 Before we go on, let's consider the components of the toolbar of Visual Basic 6.0.  Properties window, Run and Save project are what we have to focus on now.
ก่อนอื่น ขอให้เราลองพิจารณาแถบเครื่องมือของ Visual Basic 6.0 กันก่อน  Properties window, Run, Save project เป็นอะไรที่เราจะต้องโฟกัสออนกันก่อนตอนนี้ 

Design View of Visual Basic 6.0   มุมมองในโหมดออกแบบของวิชวลเบสิก

4 Controls are the genius tools that can be attached by any codes that can control any events such as clicking mouse or pressing key. Now the "Command Button" and the "Label" are the controls that we are going to use.
คอนโทรล เป็นเครื่องมืออัจฉริยะ ที่สามารถจะนำเอาโค้ดคำสั่งมาผูกติด ทำให้สามารถควบคุมเหตุการณ์ได้ อาทิ  การคลิกเมาส์  หรือการกดแป้นพิมพ์  ตอนนี้คอนโทรลที่เรากำลังจะใช้งานก็คือ Command Button และ Label

Controls of Visual Basic 6.0   คอนโทรลต่างๆ ของวิชวลเบสิก 6.0

5 Visual Basic programming begins with a form which has been named "Form1" by default. Visual Basic form simulates itself as platform which can receive many kinds of objects that created by the controls. Any object has its properties that has been shown in the properties window.
การ โปรแกรมด้วยภาษาวิชวลเบสิกนี้ จะเเริ่มจาก Form ซึ่งโปรแกรมจะกำหนดชื่อให้ก่อนเลยว่า Form1 (เราสามารถเปลี่ยนชื่อได้)  ฟอร์มของวิชวลเบสิกจะจำลองตัวมันเองเป็นเสมือนแพล็ตฟอร์ม ที่สามารถจะรองรับวัตถุหรืออ็อบเจ็กต์ที่สร้างจากคอนโทรล (ด้านซ้าย)  และวัตถุนั้นมันจะมีคุณสมบัติหรือพร็อพเพอร์ตีส์ของตัวมันเอง โดยจะแสดงให้เราเห็นในหน้าต่างพร็อพเพอร์ตีส์ (ด้านขวา) 

Form and Controls are variety kinds of object of Visual Basic that have their own properties. 
Form และ Controls เป็นอ็อบเจ็กต์(วัตถุ) ที่หลากหลายของ Visual Basic ที่มี properties ของตนเอง
6 Here we go on creating a design job like the following picture.  
    -  Using the "Command Button" control to draw the three sequence command buttons, Command1, Command2 andCommand3. 
   -  Using the "Label" control to draw the six sequence labels, Label1, 
Label2, Label3, Label4, Label5 and Label6 
ให้นักเรียนลงมือสร้างงานออกแบบ ตามรูปด้านล่างนี้เลยนะ
   -  โดยการใช้คอนโทรล Command Button วาดปุ่มคำสั่งขึ้นมาสามปุ่มตามลำดับ
   -  โดยการใช้คอนโทรล Label  วาดอ็อบเจ็กต์ต่อเนื่องกัน รวม 6 เลเบิล

Form1 would have three command buttons and six labels now.
Form 1 ที่เราออกแบบนี้ก็จะมีปุ่มคำสั่ง (command button) 3 ปุ่ม  และมีฉลาก (label) รวม 6 ฉลาก  


7 Click on "Form1", we can see its properties, rename it with "frmStopWatch" (frm is a pefix which comes from "form"). And change its caption to "Stop Watch Application".
คลิ กที่อ็อบเจ็กต์ Form1 เราจะเห็น properties ของมันอยู่ทางด้านขวา  ให้เราปรับเปลี่ยนชื่อ (name) ของมันใหม่เป็น "frmStopWatch" (frm เป็นคำนำหน้าชื่อ มาจาก form นั่นเอง)  และปรับเปลี่ยน Caption (คำอธิบายอ็อบเจ็กต์) ให้เป็น "Stop Watch Application"

Form1 Properties Configurations  การตั้งค่าคุณสมบัติของอ็อบเจ็กต์ Form1


8 Click on "Command1", yes we are about to specify the properties of this object. Rename it with "cmdStart" (cmd is a prefix which comes from "command button") and also refill its caption with "&Start Timing" (& is a prefix of the key letter that a user can press on this key together with the "alt" key instead of click on this command button). 
คลิ กปุ่ม Command1 เพื่อเปลี่ยนคุณสมบัติ  โดยให้ชื่อใหม่ว่า cmdStart (cmd เป็นคำนำหน้า มาจาก Command Button)  และเปลี่ยน Caption ให้เป็น "&Start Timing" (& นำหน้าตัวอักษรสำคัญที่จะบอกผู้ใช้ให้รู้ว่า เขาสามารถกดคีย์นี้ร่วมกับคีย์"alt"ที่คีย์บอร์ด เพื่อใช้งาน command button แทนการคลิกเมาส์ได้). 


Change the properties of the command button :  name and caption
ให้นักเรียนเปลี่ยนชื่อ และแค็ปชันของปุ่มคำสั่ง

9 Do it the same way as the previous step. ทำเหมือนขั้นตอนที่แล้ว 
Change the properties of the command button :  name and caption


10 Do it the same way as the previous step.ทำเหมือนขั้นตอนที่แล้ว

Change the properties of the command button :  name and caption


11  Change only the captions of Label1, Label2 and Label3 according to the following picture. ให้ เปลี่ยนเฉพาะ Caption ของทั้งสาม Labels เท่านั้น  ไม่ต้องเปลี่ยนชื่อ (เนื่องจากเป็นแค่ป้ายกำกับเท่านั้น ไม่ได้เกี่ยวข้องกับการกำหนดโค้ดโปรแกรม)

Change the properties of the three labels :   captions  เปลี่ยนแค่แค็ปชันของสามเลเบิลแรก

12  Change the properties of the other last three labels, "Label4", "Label5" and "Label6" by renaming them to "lblStart", "lblEnd" and "lblElapsed" and erase their captions until they are blank.
เปลี่ยน properties ของ Label4, Label5, Label6 โดยเปลี่ยนชื่อเป็น lblStart, lblEnd, lblElapsed  และลบ captions ของทั้งสามเลเบิลออกจนว่างเปล่าทั้งหมด

Change the properties of Label4, Label5 and Label6 according to the picture. 
เปลี่ยนชื่อของสามเลเบิลท้าย  และเคลียร์แค็ปชันให้ว่าง (blank)
13  Now we have just already designed and configured all of related objects, the next step of us is coding our program. Let's click on the menu-bar at the "View" command tab, then select the "Code" sub-command, the view-code window will show up. Yes, we are going to enter our source codes of our application here. 
มา ถึงตอนนี้ เราก็ได้ทำการออกแบบ และกำหนดคุณสมบัติต่างๆ ให้กับอ็อบเจ็กต์ต่างๆ ที่เกี่ยวข้องไปเรียบร้อยแล้ว  ขั้นตอนต่อไปของเราก็คือ การใส่โค้ดให้กับโปรแกรมของเรา  ให้นักเรียนคลิกไปที่แท็บคำสั่ง View ของแถบเมนู  จากนั้นให้เลือกคำสั่งย่อย Code  หน้าต่างโค้ดก็จะปรากฏขึ้น  ใช่เลย เราจะป้อนซอร์สโค้ดโปรแกรมของเราตรงนี้แหละ

Click on the "View" command at the menu bar, then select "Code" subcommand
14  The first set of source codes is about the declarations. There will be the "(General)" at the left-top of the view-code window and the "(Declarations)" at the right-top. We have to type four lines of our following source codes.
ซอร์สโค้ดกลุ่มแรก เป็นโค้ดที่เกี่ยวข้องกับการประกาศตัวแปร  นักเรียนจะเห็นว่ามี (General) อยู่ที่หัวข้อด้านซ้าย  และ (Declarations) อยู่ที่หัวข้อด้านขวา

        1st Line is about the General Declaration  เป็นคำประกาศทั่วไป
        2nd Line is the Declaration of variable "StartTime"  ประกาศตัวแปรเพื่อรับค่าเวลาเริ่มต้น
        3rd Line is 
the Declaration of variable "EndTime" ประกาศตัวแปรเพื่อรับค่าเวลาที่หยุด
        4th Line is the Declaration of variable "ElapsedTime"
 ประกาศตัวแปรเพื่อรับค่าเวลาที่ใช้ไป
15  This step is about attaching our source code to a control object. The "cmdStart" is a command button we are going to attach the source code. Let's double click on this command button, yes, this action could bring us to a module or subprogram that could be driven by an event, _click ( ), that means this subprogram could work when this command button was clicked on. 
ขั้น ตอนนี้ จะเป็นการผูกซอร์สโค้ดโปรแกรมของเราไว้กับปุ่มคำสั่ง cmdStart  ให้นักเรียนดับเบิลคลิกที่ปุ่มคำสั่งนี้ (เมื่อเราอยู่ในมุมมอง Object)  จากนั้นจะพาเราเข้าสู่ห้วงของโมดุลหรือโปรแกรมย่อย  ซึ่งโปรแกรมย่อยหรือโมดลที่ว่านี้ จะถูกขับเคลื่อนโดยเหตุการณ์ (event-driven)  ซึ่ง ณ ที่นี้ก็คือ " _click ( )" การคลิกเมาส์ของผู้ใช้โปรแกรมนั่นเอง 
 What is about this source code?  It begins with assigning the recent time value (Now) to the variable "StartTime".  Then the method "Caption" stipulates that the label "lblStart" can show up data from the variable "startTime" with the "hh:mm:ss:" format.
ซอร์ส โค้ดนี้มันคืออะไรหรือ?  โค้ดจะเริ่มจากการกำหนดให้ตัวแปร StartTime เอาค่า Now คือเวลาปัจจุบันไปเก็บไว้  ต่อจากนั้นโค้ดก็จะมีวิธีการ (Method) ที่ชื่อว่า Caption  เป็นตัวกำหนดรูปแบบการแสดงค่าของเวลา โดยเอาค่าที่เก็บไว้ในตัวแปร StartTime นั้นมาแสดงผลเวลาในเลเบิล lblStart
  
Attach code to the command button "cmdStart"
ผูกโค้ดเข้ากับปุ่มคำสั่ง "cmdStart"

16  This step is similar to the previous but it turns to the "cmdEnd" command button. But it creates the expression which assigns the variable "ElapsedTime" with the difference of the variable "EndTine" and the variable "StartTine".
ใน ขั้นตอนนี้ ก็คล้ายกับขั้นตอนที่ผ่านมา  แต่จะมีการสร้างนิพจน์คำนวณค่าส่วนต่างของเวลา ระหว่่างตัวแปร EndTime และตัวแปร StartTime และนำไปเก็บไว้ในตัวแปร ElapsedTime
  
Attach code to the command button "cmdEnd"
ผูกโค้ดเข้ากับปุ่มคำสั่ง "cmdEnd"

17  This is the end of application with the only amazing word "End"
Attach code to the command button "cmdExit"
ผูกโค้ดเข้ากับปุ่มคำสั่ง "cmdExit"


18  Congratulation to our tough project!. This is the output of our input and process. Yes, it is the "Stop Watch Application" of us.  
ขอ แสดงความยินดีกับโครงงานสุดหินนะนักเรียน  นี่คือผลที่ได้ จากการสร้างและป้อน  ประมวลผล  จนได้แอ็ปปลิเคชันนาฬิกาจับเวลา หน้าตาแบบนี้แหละน้า 

Our Graphic User Interface Application :  "Stop Watch"
แอ็ปปลิเคชันของเราที่มีรูปแบบการติดต่อกับผู้ใช้เป็นกราฟิก (GUI)
19  We have to make our project to an independent application.  Click on the "File" command at the menubar then select the "Make..to..EXE" subcommand.   
เรา ต้องทำให้โปรเจ็กต์ (โครงงาน) ของเราที่รันได้แล้วนี้ ให้กลายเป็นแอ็ปปลิเคชันอิสระที่สามารถรันได้เอง (โดยที่ไม่ต้องอาศัย Visual Basic)  ทำได้โดยการคลิกคำสั่ง File  ณ แถบเมนูคำสั่ง  แล้วเลือกคำสั่งย่อย Make..to..EXE  เท่านี้ก็เสร็จเรียบร้อย