Visual Basic Code of the Week (COTW)
http://www.codeoftheweek.com
Issue #35
All content and source code is Copyright (c) 1998 by C&D Programming Corp. No part of this issue can be reprinted or distributed in any manner without express written permission of C&D Programming Corp.

This issue is brought to you by Videosoft's VS-OCX Version 6.0. The latest and greatest control from Videosoft. It can be yours for only $149. The upgrade version is only $99. If you are interested, email videosoft@codeoftheweek.com for complete ordering details. There is a light version of the Elastic control available for only $49.

Here are the details about the control:

No more resizing code! Just add a single vsElastic control to your existing form, set a couple of properties and voila; your form becomes resolution independent, EGA, VGA, SVGA ---it doesn't matter. The vsElastic control automatically resizes all of the controls on your form.

No more switching between forms! Let the vsIndexTab control present several screens worth of data in the space of one by using notebook-style tabs like those in Word or Excel. Resize the form and watch the contents of each tab automatically resize.

No more slow code to parse strings and read files! Let the vsAwk string parser control slice and dice your strings automatically. It even includes an expression evaluator that supports variables.

No more tedious work! Let these three controls do the work for you.


Requirements for this Issue

The source code in this issue is designed for Visual Basic 4.0 and above.

In this Issue

This issue will introduced a timed message box. What this means is that you can show a message box that will "Click Ok" automatically after a certain number of seconds. This is useful for applications that run unattended sometimes but you still want to show messages boxes.

Timed Message Box (frmTimedMsgBox)

Description

This issue is a little different from others because it is going to use a form instead of a module or class module. You will need to add a new form to your project (change the Name property to frmTimedMsgBox), add a Timer control (change the Name property to tmrMsg), Command Button (change the Name property to cmdActions) and Label (change the Name property to lblMsg) . After you do this, press F7 to get to the source code and paste in the source that appears near the end of this issue.

Declaration

Public Sub ShowMessage(sMsg As String, lDelay As Long)

Parameters