devxlogo

August 9, 1997

Activating a Previous Instance of an Application

To prevent users from launching multiple instances of your application,check the PrevInstance property of VB’s App object; if the propertyis True, the program is already running. To activate the previousinstance,

Leap Year Rules

One of the trickier parts of handling date values is dealing withleap years. Everyone knows that every fourth year is a leap yearin which February has 29 days instead of

Use Your Own Popup Menus in VB4

In VB4 if you want to show a popup menu for a text box, a system-providedcontext menu appears first, and your popup menu does not appearuntil you close the system

Databound Grid Bug Solution

A severe bug in VB4 appears when using the Databound Grid withmodal forms. Create 3 forms: form1, form2 and form3. Put a buttoncommand1 on each of the forms. In the

Identifying a Generic Control at Run Time

When a procedure can operate on multiple types of controls, youcan use VB’s TypeOf function to determine a control type at runtime: Function myFunc(ctl as Control) ‘ This code works

Hexadecimal Color Constants

Properly designed Windows programs should change their own colorsaccording to the system colors. One of the reasons why developerstend to forget that part of design is that it is not

Undocumented Feature Logs Jet Queries

Jet 3.0 includes an undocumented feature that lets you log Jet’soptimization plan of queries. To enable this feature, you mustcreate this registry key using Windows’ RegEdit program: HKEY_LOCAL_MACHINESOFTWAREMicrosoft _ Jet3.0EnginesDebug