วันศุกร์ที่ 22 พฤษภาคม พ.ศ. 2558

ปรับสีเส้น dimension autocad ใช้ คำสั่ง ddim

ปรับสีเส้น dimension autocad ใช้ คำสั่ง ddim เลือก ชื่อ style แก้สี

วันพุธที่ 20 พฤษภาคม พ.ศ. 2558

เจาะพื้นรูปภาพโลโก้ ไม่ให้ติดจุดดำ เป็น background , photoshop

เจาะพื้นรูปภาพโลโก้ ไม่ให้ติดจุดดำ เป็น background
1.สแกนภาพ 400 dpi จะได้ความละเอียดสูง พัน pixel
2.เข้า photoshop ใช้ทูล magic wand  ให้เลือก uncheck ที่ continuous แล้วคลิกที่พื้น background เอา แล้วเลือก invers select
3. เลือกสร้าง file new และ เลือก background white วางรูปที่ cut มา หรือ copy มา สั่ง save
4. สั่งsave เป็น jpg เพื่อลดขนาดไฟล์ แต่ไม่ลดคุณภาพเลือก high

วันจันทร์ที่ 18 พฤษภาคม พ.ศ. 2558

sql group and having

select  renew_root_id, max(renew_rank)  ,last(id) as lastid
from tblendpro
group by renew_root_id
having max(renew_rank)
(แปล จะได้ 3 ฟิลด  renew_root_id, จะได้ค่าสูงสุด max(renew_rank)  , จะได้ค่าสุดท้าย last(id) as lastid จากตาราง tblenpro  จากการจัดกลุ่มที่โดยใช้ฟิลด์ renew_root_id เลือกเอา แต่ ค่าสุงสุดของ renew_rank ของจากแต่กลุ่มของ renew_root_id)
กรณีศึกษา จากโจทย์ ค้นหา id  ที่มี renew_rank = max จากกลุ่ม renew_root_id=id

วันจันทร์ที่ 4 พฤษภาคม พ.ศ. 2558

pdf + illustrator

กรณีพิมพ์แบบ แปลน คาน ไฟล์ pdf  เมื่อทำการ edit ด้วย illustrator เมื่อสั่งพิมพ์เส้นจะคด  ให้แก้ไขโดยสั่งพิมพ์ แบบ รูปภาพ จะแก้เส้นคดได้

วันพฤหัสบดีที่ 2 เมษายน พ.ศ. 2558

ใช้ vlc แปลง ไฟล์ และ rotation

http://www.wintips.org/how-to-rotate-and-save-a-video-using-vlc-media-player/

*** ให้กำหนดมุม ที่ angle ไม่ใช่ ที่ transform  ถึงจะส่งผล ต่อ out put stream และ save ได้


Maybe you have captured a video with your cellphone or camcorder and when you try to play it in your computer, you discover that it is rotated 90 degrees. This error happens because many cellphones don't understand the orientation. 
When you have a rotated video, you can use two free programs to rotate and save you video in the orientation you want: VLC Media Player and Windows Live Movie Maker. This tutorial guides you on how to use VLC Media Player to rotate and save your videos.
* Click here to see a detailed video on how to rotate and save a video using VLC media player (Ver 2.0.2).
Note – Update: The method bellow is working great with VLC Media Player Ver 2.0.2. If you want to use the latest VLC Media Player (Ver. 2.1.2) to rotate your videos then navigate to this link : How to Rotate Video using VLC Media Player ver 2.1.2
1. First download and install VLC Media Player from here : http://www.videolan.org/
2. Then choose your rotated video from your computer and "right click" to open it with VLC Media Player
3. In the VLC Media Player main menu go "Tools" > "Effects and Filters"
image
4. In "Adjustments and Effects" window, choose the "Video Effects" tab
image
5. In "Video Effects" tab, choose "Geometry"
image
6. In "Geometry" click the "Transform" box to enable transform and make sure that the "Rotate by 90 degrees" setting below is selected.  Then choose "Close" to close the window. Notice*: The "Rotate by 90 degrees" setting, rotates your video by 90 degrees clockwise. If you want to rotate your video in a different angle then choose the corresponding angle.image
Now you can view and play your rotated video with VLC Media player (only) in the right angle. 7. If you like to save your recent rotated video, from the main menu go to "Tools" > "Preferences"
image
 8. In Interface Settings look at the left side's bottom and choose to "Show All Settings"
image
 9. At the left pane under "Stream Output" expand "Sout stream" >"Transcode" and at right pane under "Video filter" choose the "Video transformation filter". Then click "Save" to save your settings.
image
 10. From the main menu choose "Media" > "Convert / Save"
image
 11. At "Convert/Save" options at "File" tab, choose "Add…" to add your recently rotated video file and then press the drop-down arrow on the right of "Convert / Save" button to choose "Convert"
image
 12. At "convert" options, choose "Browse", select the destination folder (e.g. "Desktop"), give a file name for the converted file (e.g. "IMG_1822Rotated") and specify the output video file type (e.g. ".MOV")
image
 13. While in "convert" options, choose your profile output: "Video – H.264 + MP3 (MP4)" and then press the "Tools" button on the right side to edit the selected profile.
image
 14. In profile settings, find and click the "Audio codec" tab
image
 15. Inside "Audio codec" settings use the drop-down arrow in codec's line and from the list of codecs choose "MP3". Then click Save.
image
 16. In "Convert" window press "Start" to start the conversion.
image
 17.As "Conversion/Streaming" process is executed, you see the following screen.
image
18. When  the "Conversion/Streaming" process is completed, you can play your video in any media player you like.
Attention: After you rotate and save your videos, you must reset VLC player to it's default settings , by going to: "Tools" > "Preferences" and press the "Reset Preferences" button at the bottom side of Preferences window.
How to rotate and save a video using VLC media player (Video tutorial)

xp ไป ws2012 customer database เซต nic teaming , intel pro/1000 mt 2 Gb , load balance ,asp classic,raid level

สรุป ขั้นตอนย้าย เซฟเวอร์จาก xp ไป ws2012 (เพื่อทดสอบเท่านั้น)



-สิ่งที่ย้ายไป  ระบบ svr tsr  stock search  จาก ระบบ web service  iis5.1 รองรับการค้นหาผ่านเวป ให้กับเวปการจัดการของบริษัทฯ(เวปเขียว) และ dbs customer (grandpc_wxx.mxx)
-สิ่งที่ต้องการ ใน ws2012 
*ต้องการ fast database อาจไปประยุกด์ app service
*ระบบรองรับ multiuser จำนวนมาก ในเวลาเดียวกัน
เมื่อใช้คำสั่ง net config server  สำหรับ xp จะได้ด้านล่าง

Server hidden                         No
Maximum Logged On Users               10
Maximum open files per session        16384

แต่ถ้าใน ws2012 จะได้  16ล้าน ใน  Maximum Logged On Users

*รองรับ load balance ,fault tolerance ,Link Aggregation  2 gigabit ใช้ intel pro/1000 mt  รองรับ ieee 802.3ad dynamic link aggregation

-สิ่งที่ควรรู้
- f12 เข้า bios backup *.adi ด้วย activedisk@image kkdminiw8.1 ส่ง image ไป ext harddisk
-การ set nic teaming (LBFO)  สำหรับ ws2012 มาแทน ANS Teams และ fail over ของ ws2008
 รายละเอียดดุได้ที่  http://www.intel.com/support/network/sb/cs-009747.htm

Windows Server 2012 adds support for NIC teaming, also known as Load Balancing and Failover (LBFO). Intel ANS teaming and VLANs are not compatible with Microsoft LBFO teams. Intel® PROSet blocks a member of an LBFO team from being added to an Intel ANS team or VLAN. Do not add a port that is part of an Intel ANS team or VLAN to an LBFO team. Adding a port can cause system instability.
If you use an Intel® ANS team member or VLAN in an LBFO team, do the following procedure to restore your configuration:
  1. Reboot the server.
  2. Remove LBFO team. Even though LBFO team creation failed, after a reboot the Server Manager reports that LBFO is Enabled. The LBFO interface is present in the NIC Teaming GUI.
  3. Remove the Intel® ANS teams and VLANS involved in the LBFO team and recreate them. This step is optional but strongly recommended. All bindings are restored when the LBFO team is removed.
NoteIf you add an Intel AMT enabled port to an LBFO team, do not set the port to Standby in the LBFO team. If you set the port to Standby you can lose AMT functionality.
-การเซตค่าต่างๆ

 เร่ิ่มเตรียมระบบ ws2012
-ด้วยสเปค






โดยแบ่ง เป็น 2 partition c: และ d: เมื่อทำ raid0 บน 2 ssd  จะได้ ความเร็วและพื้นที่ แต่ไม่มี data protect (no mirror)

ถ้าให้ดีต้องทำ raid 10 ไปเลย แต่ ต้อง 4 ssd ขึ้นไป จะได้ Protect และ Read/Write Perfomance ด้วย กด Ctrl+I เข้าไปเซต raid หลังเปิดเครื่อง
บทความนี้ใช้ ssd *2 ทำ raid 0 ไปก่อน ลองทดสอบความเร็ว ซึ่งในระบบ backbone ของบริษัท ได้วาง giga switch ไว้แล้ว มีเครื่องลูกประมาณ 20 เครื่อง แบบ workgroup แต่ถ้าอยากต้องการความเร็วที่แท้จริง ควรวางสาย cat6(มีกระดูกในสาย) แท้ไปเลย  จะเห็นความเร็วได้ชัด(ทดสอบจากการค้นหารายชื่อในฐานข้อมูล ทำความเร็วได้แตกต่างจากเดิมมาก คือค้นหาได้เร็วขึ้นอย่างชัดเจน หลังจากเซตระบบทั้งหมดแล้ว เช่น Teaming featuer 2Gb)


ข้อมุลการติดตั้ง raid level ที่รองรับ จากคู่มือของ mainboard



-ลง ระบบ ws2012 datacenter r2 64bit  เมื่อลงเรียบร้อยแล้ว
*ก่อนให้ disable lan onboard ก่อน
ให้ทำการเซต nic teaming  ปกติไดรเวอร์จะลง ans service ให้เอง เราต้องเอา ans service นี้ออกก่อน ถึงจะใช้ nic teaming ใน ws2012 ได้ ก็โดย รัน swtools ใน ไดรฟ c: เรียนไดร์เวอร์ setup ของมันขึ้นมา เอา ติ๊กถูกออก และให้ รีสตารท์ หลังจากนั้น กำหนด NIC Team ที่ local server ได้ในหน้า sever manager ได้เลย ตั้งใช้ teaming ให้ enable







-ลง web service iis8.5

โดยเข้าไปกำหนดใน role แล้วเลือกติดตั้ง iis8.5 และ asp ถ้าเวปเดิมของเรา เขียนด้วย asp classic




ทำการ copy โฟลเดอร์ database ของเรา ไป เช่น findendpromise  ไปไว้ ที่ d:\ แล้วทำ findendpromise 
*ตั้ง mime-type  *.asp และ *.asa และ กำหนดให้ debug ได้ และ กำหนด set parent ให้ใช้งานได้ (คือ "
..")
*ให้ access ได้โดย iis โดยให้ตั้ง สิทธิ การเข้าถึงไปกับ IUSR   เหมือนตั้งสิทธิการแชร์ทั่วไป ใน แทป sercurity
*เข้า iis server manager กำหนดให้ 32bit application ให้ enable ให้ app pool เพือใช้งาน database ได้ 
*ทำ virtul directory ให้กับ findendpromise เพื่อกำหนด root ของ site ใหม่ 
*กำหนด port forward ที่  binding  และเซต firewall เข้าไปที่ allow port ที่ advandce firewall  ถ้าเราต้องการให้ รีโมตเข้ามาใช้งานได้
*ในส่วน ของ Offline Program (เช่น โปรแกรม Findendpromise ) กำหนด user และ รหัสผ่าน ให้เข้าถึง database ให้กับโฟลเดอร์ findendpromise ที่ เซฟเวอร์  โดย app findendpromise ที่ เครื่องclient ได้ (จุดนี้ findendpromise client จะสร้าง user และ passwd ขึ้นมา ให้เอง และจะ log out  user ให้เมื่อปิด findendpromsie client)
ws2012 ตัวใหม่ (ทำไว้เพื่อกรณีศึกษาเท่านั้น) ทำหน้าที่ customer database server

switching gigabit + สาย cat5e และ cat6 ผสมกัน + 2 adsl ทำ load balance กัน ใช้net ทั้งของ 3bb และ true

box server เก็บ data ทั้งของ บริษัทและ user

freenas server เก็บข้อมูล bittor, ubuntu server เป็น proxy server และ ใช้ทำ load balance , forward port ,firewall

cctv server เก้บ ข้อมุลกล้อง+remote ดุผ่าน pcและ มือถือ

customer database ทดสอบตัวใหม่ตามบทความที่เขียน



rdp server  และ ipcamera server เก้บข้อมุล clip ipcamera ดู่ผ่าน pc และ มือถุือ

xp server ตัวเก่าใช้มา มากกว่า 7 ปี ฮารด์ดิส 1 ide interface เพียวๆสุดทน แค่เปลี่ยน แรม2g กับ psu

วันศุกร์ที่ 27 มีนาคม พ.ศ. 2558

การลง vb6 ใน win7
1.ดู http://www.tipsiam.com/%E0%B8%A5%E0%B8%87-vb-%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%84%E0%B8%94%E0%B9%89

http://www.fortypoundhead.com/showcontent.asp?artid=20502

Install VB6 on Windows 7

Visual Basic 6
Posted On 2009-06-23 by dwirch
Keywords: 
Tags: Visual Basic 6 Tutorial Software Hack/Tweak  Windows 7 Vista Windows
Views: 425223
Rating: 4.67 / 5.00
  •  
  •  
  •  
  •  
  •  

After surfing around the net, I've found very little information regarding installation of VB6 on Windows 7. Most of the information out there is for Vista, and most of it is queries for assistance.
You may be wondering why someone would want to utilize VB6 on a shiny new operating system like Windows 7. Or even Vista for that matter.
There are about a bazillion legacy applications out there that have to be supported, and people like me who speak VB6 need to have the tools installed on our workstations in order to implement and test updates and such for these legacy applications. It also helps out when I need to squirt out a quick tool for use in my daily work. 
This process has been tested on Windows 7, both 32 bit and 64 bit, with no problems.
Note: I've updated this process with information from the comments (below the post). If I've left something out, don't hesitate to point it out. Also - Thanks to all of you! Your comments and suggestions are much appreciated.
Note 2: If you have a specific programming questions, might I please direct your attention to the VB6 forum? It's much easier to interact over there!
  1. Prerequisites:
    You need to do this stuff first:
    • Turn off UAC.
    • Create a zero-byte file in C:\Windows called MSJAVA.DLL. The setup process will look for this file, and if it doesn't find it, will force an installation of old, old Java, and require a reboot. By creating the zero-byte file, the installation of moldy Java is bypassed, and no reboot will be required.
    • Install DirectX 7. The process and files are available here.
    • Install VB6 Common Controls, available here.
  2. Main Installation:
    1. Insert Visual Studio 6 CD.
    2. Exit from the Autorun setup.
    3. Browse to the root folder of the VS6 CD.
    4. Right-click SETUP.EXE, select Run As Administrator.
    5. On this and other Program Compatibility Assistant warnings, click Run Program.
    6. Click Next.
    7. Click "I accept agreement", then Next.
    8. Enter name and company information, click Next.
    9. Select Custom Setup, click Next.
    10. Click Continue, then Ok.
    11. Setup will "think to itself" for about 2 minutes. Processing can be verified by starting Task Manager, and checking the CPU usage of ACMSETUP.EXE.
    12. On the options list, select the following:
      • Microsoft Visual Basic 6.0
      • ActiveX
      • Data Access
      • Graphics
      All other options should be unchecked. Click Continue, setup will continue.
    13. Finally, a successful completion dialog will appear, at which click Ok. At this point, Visual Basic 6 is installed.
    14. If you do not have the MSDN CD, clear the checkbox on the next dialog, and click next. You'll be warned of the lack of MSDN, but just click Yes to accept.
    15. Click Next to skip the installation of Installshield. This is a really old version you don't want anyway.
    16. Click Next again to skip the installation of BackOffice, VSS, and SNA Server. Not needed!
    17. On the next dialog, clear the checkbox for "Register Now", and click Finish.
  3. IDE Compatibility Setup
    In order to prevent weird behavior of the IDE, such as sluggishness and/or lack of control placement/resizing outlines, you'll want to change these items.
    1. Using Windows Explorer, browse the location where you installed VB6. By default, the path is C:\Program Files\Microsoft Visual Studio\VB98\
    2. Right click the VB6.exe program file, and select properties from the context menu.
    3. Click on the Compatibility tab.
    4. Place a check in each of these checkboxes:
      • Run this program in compatibility mode for Windows XP (Service Pack 3)
      • Disable Visual Themes
      • Disable Desktop Composition
      • Disable display scaling on high DPI settings
  4. Service Pack 6 Installation:


Read more: http://www.fortypoundhead.com/showcontent.asp?artid=20502#ixzz3VaNvIRyf

บางท่านอาจจะคิดว่าเป็นที่วินโดว์เพราะเห็นบางเครื่องลงได้ ก็จริงครับ ถ้าเป็นวินโดว์ที่ได้รับการปรับแต่งแล้ว เช่น แผ่น Quick PC พวกนี้จะตัดความสามารถบางตัวของวินโดว์ออกไปทำให้ลง VB6 ไม่ได้ ฉะนั้น เราต้องไปเปิดความสามารถตัวนี้ก่อนโดย
คลิกปุ่ม Start >> run ป้อน regedit แล้ว OK
แล้วเข้าไปแก้ Registry
HKEY_LOCAL_MACHINE >> SOFTWARE >> MICROSOFT >> WINDOWS NT >> CURRENT VERSION >> perlib
ถ้าหาก ลงทะเบียน  mscomctl.ocx ได้แล้ว ถ้าหากยังใช้ไม่ได้ ให้กด apply ใน component แล้วปิดลองเข้า vb ใหม่อีกครั้ง

***

เทคนิคการเขียน VB6 ให้รันได้ทุกวินโดวส์ (Portable)

การสร้าง Portable

http://thaivb6.blogspot.com/2013/11/vb6-portable.html
ผมเป็นคนหนึ่งที่ชอบการเขียนโปรแกรมด้วย VB6 บางคน...นั้นเน้นงานธุรกิจ จะติดมาโครของ MS-Office แต่ข้อเสียของ MS-Office คือ มันพกพาไปเล่นเครื่องอื่นๆ หรือเครื่องคนอื่นไม่ได้ ครั้งหนึ่งเคยเขียน Antivirus บน Macro แต่ท้ายที่สุด คัดลอกไปรันเครื่องอื่นไม่ได้เพราะต้องติดตั้ง MS-Office รุ่นที่เขียน อีกอย่างคือ ไฟล์ที่จะรันคำสั่งบนนั้นต้องทำงานผ่าน Word หรือ Excel อีกที...ซึ่งมันไม่เหมาะเลย...สำหรับวัยเก๋า...จะพกพาโปรแกรมส่วนตัวไปแบบ Hacker อนาคตมืดมน
ทางเลือกคือ


  1.  เขียนผ่าน VBScript และทำงานมันผ่านหน้าเวป เอ...เข้าท่า...(เรือจอด) แต่มันเขียนโครตยากถ้าไม่มี Tool เพราะ...ไวยกรณ์ภาษาอังกฤษไม่แม้น (เรือจม) เขียนมาติด Error และดีบักผ่านหน้า Browser โครตยาก...ไม่รู้ด้วยมัน Error ตรงไหน...ลืมประกาศตัวแปรอะไร
  2. ผ่าน VB6 หรือ โอ...พระเจ้ามาโปรด...โครตง่าย มี อิลิเมนต์ให้เลือกใช้ในคำสั่งแต่ละคำสั่ง...มี Debug ชั้นยอด มี GUI ของวินโดวส์ครบ...
ทุกวันนี้เลยติด VB6 และพกพา VB6 Portable ใส่ Sky Drive ไว้เล่นได้ในทุกที่ทุกวินโดวส์ แต่ืคุณต้องทำความเข้าใจก่อนว่า...มันก็ไม่หมูเลยที่จะเขียนโปรแกรมที่สร้างโดย VB6 ไปรันในทุกเครื่องหรือทุกแพลต์ฟอร์มวินโดวส์ ติดปัญหาแีรกคือ
  1. รีเฟอร์เรนต์ ที่ประกาศใช้ในเครื่องที่เราเีขียน ไม่มีในเครื่องอีกเครื่องที่นำไปใช้...เจอบ่อยมาก...เช่นเขียน Antivirus ที่สั่งฟังก์ชั่นหาไวรัสผ่าน File System Object หรือ FSO ของ Runtime API ซึ่งมันไม่ได้มีใน XP ทุกเครื่อง ต้องติดตั้ง...ในบางเครื่อง และผู้ใช้งานจะรู้ไหมว่า...ต้องติดตั้งหรือโดนไวรัสทำให้โปรแกรมเดี้ยง...กรรรม
  2. API บางตัวที่ใช้งานไม่มีในอีกเครื่อง หรือ ข้ามจาก XP ไป 7 มันได้ถูกยกเลิกไปแล้ว...เช่น Common Dialog ต่างๆ ของ VB6 บางตัวไม่สามารถรันบน 7 ได้เพราะถูกยกเลิก...ผมถึงต้องเขียนโปรแกรมที่เป็น Dialog ของตัวเองใช้งานแทน
  3. ถ้าคิดจะเขียนด้วย .NET เองก็มีปัญหาเช่นกัน เพราะ .NET มาหลัง XP SP1 SP2 ดังนั้นมันจึงไม่มีให้ใช้งานต้อง Download อีก
  4. ปัญหาใหม่...เครื่องมือรูปภาพของ VB6 นั้นแสดงใน Windows 7 แล้วไม่ได้ผลลัพธ์ที่ต้องการหรือไม่สามารถแสดงผลได้ตามต้องการ (เสียหายหลายแสน) ฉนั้นการเรียกใช้ Picture1 มีปัญหาแน่ในอนาคต Image1 เองก็เช่นกัน มีช่องไฟห่างกันเกิน จึงทำให้ VB6 ไม่เหมาะจะเขียนเกมส์หรือสร้างฟอร์มแบบอลังการเพื่อแสดงถึงความสวยงามของฟอร์มที่ออกแบบมาแบบไฮเปอร์ แต่เลอะเลือนมากใน Windows 7
  5. Windows 8 การแสดงผลของภาพ...ถูกแก้ไข...แต่เช่นเดิม API บางตัวถูกตัดออกไป...ต้องศึกษา    เิชิงลึกเพื่อดูว่า...อะไรที่ถูกตัดออก
การเขียนโปรแกรม VB6 ให้รันได้ทุกแพลตฟอร์ม
  1. ต้องตัดรีเฟอร์เรนต์ที่ไม่จำเป็นออกให้หมด...เอาแต่ Tool ที่มีอยู่ โดยไม่ต้อง Add In อะไรเข้ามาอะไรที่มีอยู่ตั้งแต่ต้น...มันรันได้ทุกวินโดวส์อยู่แล้ว...แม้แต่เครื่องมือฐานข้อมูล (เพียงแต่ต้องอาศัย Office 97 ผนวกฐานข้อมูลเข้าไป)
  2. อย่าใช้ API สิ้นเปลือง อะไรที่สามารถทำได้ใน VB6 ควรใช้ เช่น Sleep คำสั่งนี้...ปกติ Timer สามารถทำงานเทียบเคียงได้...ซ้ำยังดีกว่าด้วยซ้ำ...เดียวจะมาสอนเขียนกัน
  3. อย่าใช้งานกราฟฟิก ฟุ่มเฟื่อย...เพราะความสวย...เข้ากันไม่ได้กับ Window 7 แสดงผลไม่เป็นจริงใน Windows 8 (เหมือน "ลำยอง" สวย แต่ "เฟะ" ในที่สุด)
  4. อาศัยลูกบ้าพลังเช่น API BitBlt สามารถใช้คำสั่ง Picture แทนได้โดยไม่จำเป็นต้องประกาศการตัดแบ็คกาวด์ แบบ Source Code รุ่นโบราณ สมัย VB5 ฉนั้น ควรประยุกค์คำสั่งที่มีอยู่และใช้ให้เต็มที่
  5. ฟังก์ชั่นหา DIR หรือ Search DIR สามารถประยุกต์ Tool DIR และ Drive และ File ใช้แทนได้...จะมาสอน
การแก้ปัญหาเรื่อง Sleep หรือ การหน่วงเวลาคำสั่งใน VB6 ระดับ Millisecond ขึ้นไป




Private Sub Form_Click() ' คลิกฟอร์ม
    Dim N As Integer ' ประกาศตัวแปรใดๆ
    For N = 1 To 100 ' ทดสอบวนลูปคำสั่ง
        Me.Caption = N ' ส่งผลการทำงานใน Caption Form
        Timer1.Enabled = True ' เริ่มการทำงานของ Timer
        Do ' ทำ
            DoEvents ' อินเตอร์รัพต์เหตุการณ์
        Loop While Timer1.Enabled ' ถ้า Timer ยังทำงาน รอ...
    Next N ' ถัดไป
End Sub

Private Sub Timer1_Timer() ' Timer หน่วงเวลา ทดสอบ Interval = 1
    Timer1.Enabled = False ' รอ 1 มิลลิวินาที จึงปิด
End Sub

คำสั่งตัวอย่างนี้...จะเป็นการหน่วงเวลาในใดๆ ของ VB6 ก็ได้ โดยไม่จำเป็นต้องนำ Source ไปวางใน Timer อย่างใด...จากที่เคยใช้มา...จะมีปัญหากับบาง Loop การทำงานเช่น การ Drag วัตถุ หรือ Mouse_Move จะเกิด สแตกซ์โอเวอร์โฟรว...ได้

ส่วนฟังก์ชั่นการตัดแบกกาวด์ด ยังไม่นำเสนอเพราะยังหาวิธีแก้ไขกับ Windows 7 ไม่ได้...จึงเขียนตัวอย่างบนเครื่อง Windows 7 ไม่ได้

การสร้าง Common dialog ใช้เอง

Private Sub Drive1_Change()
    On Error GoTo NoDrive:
    Dir1.Path = Left(Drive1.Drive, 2) & "\"
    File1.Path = Dir1.Path
    List1.Clear
    For N = 0 To Dir1.ListCount - 1
        List1.AddItem Mid(Dir1.List(N), 3)
    Next N
    For N = 0 To File1.ListCount - 1
        List1.AddItem File1.List(N)
    Next N
    GoTo OkDrive:
NoDrive:
    Call MsgBox("ไม่พบดิสก์ไดร์ฟที่ระบุ", vbOKOnly, "ผิดพลาด")
OkDrive:
    Label1.Caption = Dir1.Path
End Sub

Private Sub Form_Load()
    Call Drive1_Change
End Sub

Private Sub List1_Click()
    For N = 0 To List1.ListCount - 1
        If List1.Selected(N) Then
            If Left(List1.List(N), 1) <> "\" Then
            End If
        End If
    Next N
End Sub

Private Sub List1_DblClick()
    Dim OK As Boolean
    OK = False
    For N = 0 To List1.ListCount - 1
        If List1.Selected(N) Then
            If Left(List1.List(N), 1) = "\" Then
                Dir1.Path = IIf(Len(Dir1.Path) = 3, Left(Dir1.Path, 2), Dir1.Path) & List1.List(N)
                File1.Path = Dir1.Path
                OK = True
            End If
        End If
    Next N
    If OK Then
        List1.Clear
        If Len(Dir1.Path) > 3 Then List1.AddItem "\.."
        For N = 0 To Dir1.ListCount - 1
            List1.AddItem Mid(Dir1.List(N), Len(Dir1.Path) + IIf(Len(Dir1.Path) = 3, 0, 1))
        Next N
        For N = 0 To File1.ListCount - 1
            List1.AddItem File1.List(N)
        Next N
        Label2.Caption = Dir1.Path
        While Label2.Width > 5145
            Label2.Caption = Right(Label2.Caption, Len(Label2.Caption) - InStr(1, Label2.Caption, "\"))
        Wend
    End If
    Label1.Caption = Label2.Caption
End Sub

Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 32 Or KeyCode = 13 Then
        Call List1_DblClick
    End If
End Sub

Private Sub Text1_LostFocus()
    If Left(Text1.Text, 2) <> "*." Then Text1.Text = "*.*"
    File1.Pattern = Text1.Text
    File1.Refresh
    Dir1.Refresh
    List1.Clear
    If Len(Dir1.Path) > 3 Then List1.AddItem "\.."
    For N = 0 To Dir1.ListCount - 1
        List1.AddItem Mid(Dir1.List(N), Len(Dir1.Path) + IIf(Len(Dir1.Path) = 3, 0, 1))
    Next N
    For N = 0 To File1.ListCount - 1
        List1.AddItem File1.List(N)
    Next N
    Label2.Caption = Dir1.Path
    While Label2.Width > 5640
        Label2.Caption = Right(Label2.Caption, Len(Label2.Caption) - InStr(1, Label2.Caption, "\"))
    Wend
End Sub

ตัวอย่างการใช้งาน