We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

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.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

DevX - Software Development Resource

Use RLEs to Reduce EXE Size

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)

DevX - Software Development Resource

Obtaining System Date Format

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,

DevX - Software Development Resource

Trimmed to Fit

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

DevX - Software Development Resource

Prevent Unwanted Recursion

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,

DevX - Software Development Resource

“File Exists?” Revision

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

DevX - Software Development Resource

Long File Names Can Be Confusing

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.

DevX - Software Development Resource

Calculate Age Using DateDiff

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

DevX - Software Development Resource

Clear the Clutter

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

DevX - Software Development Resource

Please Stop Printing!

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

DevX - Software Development Resource

Evaluating Elapsed Minutes

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) –

DevX - Software Development Resource

Show an Hourglass When Processing Data

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

DevX - Software Development Resource

Current Computer Name on Windows 95/NT

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

DevX - Software Development Resource

Show Fonts as you Select Them

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 =

DevX - Software Development Resource

Shortcuts for the VB Environment

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

DevX - Software Development Resource

Get all Matching Files in a Directory Structure

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

DevX - Software Development Resource

Trap Right-Clicks on TreeView’s Nodes

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

DevX - Software Development Resource

Getting UserID on Windows 95 and NT

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

DevX - Software Development Resource

Run VB Using the Sendto Menu

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

DevX - Software Development Resource

Fixing a Proper Case Tip

If you use the left arrow key to go back to the beginning of a word and then enter a letter, you get twouppercase letters. Use this code, which takes

DevX - Software Development Resource

Used Bytes in a Directory

This function returns the number of bytes used on the directory: Function DirUsedBytes(ByVal dirName As _ String) As LongDim FileName As StringDim FileSize As Currency’ add a backslash if not

DevX - Software Development Resource

Get Useful Disk Information

This function returns the hard disk free bytes, total bytes, percentage of free bytes, and used space. Before calling the function, set the first field of the DISKSPACEINFO structure (“RootPath”)

DevX - Software Development Resource

Trapping a Double Click for a Toolbar Button

VB4 supports the built-in Win95 Toolbar control, which allows users to add Buttons to the toolbar. The buttonhas a ButtonClick event, but if you want to trap a double-click, there

DevX - Software Development Resource

Test for “File Exist” the Right Way

Dir$ raises a runtime error if you supply it an invalid drive. For example, Dir$ (“d:winhimems.sys”) crashes ifdrive d: doesn’t exist. To check if a file exists, add an error

DevX - Software Development Resource

Use a Collection to Filter out Duplicate Values

This code illustrates how to use a Collection to automatically generate a unique set of values from a set of datacontaining duplicates. In this example, scan a string array and

DevX - Software Development Resource

Procedures that Act on a Group of Controls

You can use the almost-forgotten ability of Visual Basic to have a function or sub with an undeterminednumber of arguments do something to a set of controls. For example, you

DevX - Software Development Resource

Constituent Controls are Private to UserControl Modules

You cannot directly access constituent controls on a UserControl component from another module of the sameproject. Constituent controls behave differently from controls on forms, which you can access from any

DevX - Software Development Resource

Encrypted Passwords

These two small, simple, and effective functions easily encrypt/decrypt a text password. The functions taketwo parameters: a number in the range of 1 to 10 used to alternatively shift up

DevX - Software Development Resource

Put VB Intrinsic Constants to Good Use

I’ve seen several tips using numeric values instead of the corresponding Visual Basic constants. Always usethe Visual Basic predefined constants. For example, you can set up a message box using