devxlogo

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

Streamline Your API Declares, Part 1

Most Windows API routines are functions and must be declared assuch, but in many cases we are not really interested in theirreturn value. The SendMessage function, for example, dependingon the

Double-Check Val Arguments

When using the Val function, VB has a quirk that causes a type mismatch error. For example, Val(“25%”)correctly returns 25, whereas Val(“2.5%”) misinterprets the string and returns a type mismatch

Showing “&” Character in Labels

If you want to show the character “&” instead of having it work as a marker for the access key, set theproperty “UseMnemonic” to False. This property is useful, for

Control Boxes And Close Buton

A form’s control box property usually controls both the system menu(control box) and the close button (X in the top right corner) on the form.If the ControlBox Property is set

A String Cleaner

At times it’s useful to have a function that cleans a string of unwanted characters. This small function acceptsthe string you want to clean and the characters you want to

Test Objects Using TypeName

You can determine the class of an object using the TypeName function instead of the If TypeOf statement.Use the TypeOf statement to determine the type of object: If TypeOf myObject

Limitation Of ImageList Control

Each image that is displayed in a TreeView or ListView control mustfirst be placed in an ImageList control. If many items are placed in thecontrol, it will run out of

Cool Commands for Your Help Menu

Most Windows applications include the following commands in the helpmenu: Contents Search For Help On… How To Use Help Although VB doesn’t provide direct support for these commands,they can easily

Choose Compares Carefully

A straight ASCII compare, such as ‘F “A” < "B"THEN' is much faster then using VB's StrComp("A", "B",1). However, when you use this test to sort an array of strings,

Comparing Long And Short File Names

When you reference files in Windows 95, you may encounter situationswhen you are unsure whether you’re working with a long or short file name.This becomes a problem if you are

Use A Class To Convert Code

In VB3 if you wanted to convert your code from one custom control toanother, there were no options other than changing your code. By writingthe proper class you can make

Move and Resize Controls with Accuracy

Ever tried to align controls just right, or resize them to justthe exact size? It can be tricky with the mouse, and modifyingthe properties can be time consuming. This tip

Allow Multiple File Names In An Open File Dialog Box

If you want to allow multiple file names in an open file dialog box(Flags OFN_ALLOWMULTISELECT), the resulting FileName string will consistof the drive and directory path followed by a space-separated

Avoid an ODBC Error Referencing SP_Statistics

After opening a record set on a SQL server, this ODBC error occurs: ODBC–call failed. [Microsoft][ODBC SQL Server Driver][SQL Server] (#20001) Attach the SQL Server table and open a record

Handling Long INI File Entries

INI file entries can be so extremely long that the normal way of sizinga string before retrieving the entry may not be sufficient. This most frequentlyis true when retrieving the

Create An Access/Quicken-Like Combo Box

This example shows how to make a combo box act like those found in Quickenor Microsoft Access, without using a third-party VBX. As each characteris typed, the elements in the

Keeping Accurate Time In VB

I developed a CBT project which required the user to read large amountsof text. I wanted to prompt the user to take a break after a period oftime. The problem

Padding a Date String

Some functions return dates in single units (1st May 1996 maybe returned as 5-1-96). This makes formatting difficult whereyou have dates like 5-1-96 and 12-15-96 on the same column. The

Don’t Let Go Without Notice

Users may unexpectedly quit your application by clicking the closemenu in the control box or by clicking the close button underWindows 95. Add a procedure to the QueryUnload event on

Creating Disabled or Etched Icons

Here’s how to create an etched or disabled icon using an icon editor:1. Change all filler color to light gray. 2. Change the outline to dark gray (usually from black).

Conditionally Compile Your Code

Most developers know about VB4’s Conditional Compilation feature, where you can declare WindowsAPIs for 16-bit and 32-bit operating systems: #If Win#32 then ‘If running in 32-bit OS Declare SomeApi….#Else ‘If

License Errors in VB4

I ran across an interesting problem trying to install VB4 EnterpriseEdition in the Windows 3.1 environment. The new version of VBuses the Registry database, which in Win 3.1 is limited

Activating the Previous Instance of Your App

There are many times when you may not want to allow more than one instanceof your application to be launched. In such cases, your program needs todetermine if an instance

Constant Failure? Don’t Do That!

Most things in VB4, including the VBA and VB engines, are OLEobjects. In some cases, objects can expose properties or methodswith the same name as in another object. Theoretically, the