วันอาทิตย์ที่ 8 กันยายน พ.ศ. 2556

Visual Basic 6.0 : Exercise แบบฝึกหัด วิชวลเบสิก 6.0

Visual Basic 6.0 : Exercise แบบฝึกหัด วิชวลเบสิก 6.0

     


Exercise 1

Calendar/Time Display

   SOURCE  :   www.kidwares.com

1 Design a window application that displays the current month, day, and year.  Also, display the current time, updating it every second (look into the Timer control).  Make the window look something like a calendar page.  Play with object properties to make it pretty.

ให้นักเรียนออกแบบหน้าต่างแอ็ปปลิเคชัน ที่แสดงเดือนปัจจุบัน วันที่ และปี  และยังแสดงเวลา ณ ปัจจุบัน ที่จะอัปเดตทุกวินาทีอีกด้วย (เหมือนกับนาฬิกาจับเวลา)  หน้าต่างแอ็ปปลิเคชันนี้จะคล้ายเหมือนใบปฏิทิน  และให้นักเรียนตกแต่งอ็อบเจ็กต์ต่างๆ ให้ดูดี




2 Configure the properties of the related objects like the followings.
 ทำการตั้งค่าต่างๆ ให้กับอ็อบเจ็กต์ที่เกี่ยวข้อง เหมือนค่าที่กำหนดมาให้ตามนี้

Configuration 1





Configuration2



Configuration3



3  Attach the source codes to the objects. There is only the Timer "timDisplay" object that we have to attach our source codes to.  Although there is no any variable declared, but we have to type the code "Option Explicit" at the General Declarations module.
 ทำการผูกซอร์สโค้ด (รหัสโปรแกรม) เข้ากับอ็อบเจ็กต์  สำหรับงานนี้จะมีเพียงอ็อบเจ็กต์ไทเมอร์ ที่ชื่อ timDisplayเท่านั้น ที่เราจะต้องใส่โค้ดผูกไว้

Source codes that we have to type.


This is the "Sample Special" output of our project ,
(according to our "date/time" format of our machine configuration)
ตัวอย่าง ผลการรันโปรแกรม
(การแสดงผล ขึ้นอยู่กับการตั้งค่า รูปแบบ "วัน/เวลา" ของเครื่องคอมพ์ที่นักเรียนใช้งานอยู่)

ไม่มีความคิดเห็น:

แสดงความคิดเห็น