

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.








I wrote a unique error-proof number generator that greatly simplifies the checking of clients’ accountnumbers or other IDs used by your application. I use it in conjunction with the CheckForValid
If you are using the new mail program that can be downloaded for free from Microsoft’s Web site, you can run it from within your program. Simply add this command
You can use the Wingdings font to put simple graphics on a standard command button. Put a standard command button on a form, and in the Properties window, change the
“Hide” an MDI child form with a non-sizable border style (0 or 1) using this code in the MDI child’s Form_Load event: form1.Move form1.Left, form1.Top, 0, 0 Use a label
The API functions “_hwrite” and “_hread” can be useful for writing arrays directly to files and, at some later time, reading these files directly into arrays having the same structure.
Columns in a DBGrid control are bound to database fields. However, the index number of a column doesn’t tell you which field it represents. Therefore, referring to DBGrid1.Columns(0).Value is not
The tip “Remember SWAP?” [“101 Hot Tech Tips for VB Developers,” Supplement to the August 1996 issue of VBPJ, page 13] has a common error. This line actually creates three
When using the line-continuation character facility-the combination of a space followed by an underscore (_) used in the development environment to extend a single logical line of code to two
Omitting the counter from a Next statement does not speed up a For loop. Calling a procedure in a BAS module is not slower than calling a procedure contained in
When you’re dynamically adding ColumnHeaders to a ListView control at run time, you may not know how long the text for the header will be, so the user must readjust
Many programs use a splash screen to display the logo of the program. The logo is usually made by an image. You used to store it as a BMP (uncompressed)
In VB5, the event is not called when an instance of your UserControl is copied into the clipboard andpasted again, creating a new one. This affects user controls that depend
The DateCheck function is useful when you use the Masked Edit control for entering the date according to the system format. Some countries use the MM/DD/YYYY format, and other countries,
This piece of code trims long file names to fit into forms captions, text boxes, and other limited spaces. The code allows you to specify the number of characters a
A bug affecting the Sheridan 3D Controls appears in VB 4.0a. I don’t believe it was in 4.0, and I am certain it was not in 3.0. In any case,
To adapt the tip “File Exists?” (see “101 Hot Tech Tips for VB Developers,” Supplement to the August 1996 issue of VBPJ, page 7) to a directory list box, it
If you want to open Paint with a file from your application, it’s better to convert the path of the file you want to open from long to short names.
Use the function DateDiff to calculate an individual’s exact age based on birth date. DateDiff first calculates the total number of days an individual has been alive and then divides
Provide your users with a quick way to clear their “messy desktop” of extraneous forms by dropping this code into the Click event of a command button: For Each Form
Sometimes I want to print data from a recordset to a report, reading and printing each record. However, it’shard to interrupt that process before it sends all recordsets to the
You might need to keep track of the total minutes between one date or time and another. To get the totalminutes, use a line like this: lTotalMinutes = Minutes(Now) –
Have you ever forgotten to add code to set the MousePointer back to its default at the end of a procedureor function? This technique simplifies showing and resetting the MousePointer
You often want to know the name of the current computer running Windows 95 or Windows NT in your VB program. Use this simple wrapper function of a kernel32.dll API
To let a user change a font name, load all the fonts into a combo box: Private Sub Form_Load() ‘ Determine the number of screen ‘ fonts. For I =
1) In VB5, pressing Ctrl-F3 when the cursor is over a word automatically searches to the next occurrenceof that word, bypassing the search dialog. You need to be past the
Because this code doesn’t use an API, you can easily port it between 16- and 32- bit applications. TheDirWalk procedure lets you search an entire directory structure starting at whatever
The TreeView control gives your apps a good Windows 95 look and feel. However, the VB manual doesn’texplain how to trap the right mouse button in a node. The Treeview_MouseDown
You often want to get the user ID of the current user on the machine running Windows 95 or Windows NT.Use this simple wrapper function of an API function to
Adding a “Shortcut to VB.exe” and “Shortcut to VB32.exe” to your “Send To” menu lets you right-click onany VBP project and open it with your choice of VB4 16/32 or
When selecting items in a normal list box with the MultiSelect property set to 1 – Simple or 2 – Extended,the user needs to press the control key while clicking

