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

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

Cool Screen Wipes

You can achieve some cool form wipes with judicious use of the Movemethod. For example, to draw a curtain from right to left use this routine: Sub WipeRight (Lt%, Tp%,

DevX - Software Development Resource

Get Date and Time Delimiters Without API Functions

Use these easy algorithms to obtain the current Date, Time, and Decimal delimiters used by Windowswithout resorting to Locale Settings or API calls: DateDelimiter = Mid$(Format(Date, _ “General Date”), 3,

DevX - Software Development Resource

GPF in VB.EXE

What do you do when you get a GPF in VB.EXE? Remember that Windows requiresyou to ensure memory integrity when calling API functions. A GPF in VB.EXEcan be produced if

DevX - Software Development Resource

Subclassing ChDir

If your application’s current directory is D:OldDir, the callChDir(C:NewDir) will change the C Drive’s default directory toNewDir, but the application’s current directory will remain D:OldDir.It seemed to me that ChDir

DevX - Software Development Resource

Change Tab Order Sequence

While in design mode, the tab order may get out of sequence, especiallyif you add a control after all the others are set in place. You can setthe TabOrder sequence

DevX - Software Development Resource

To Sync Or Not To Sync (ASYNC) ODBC Queries

Here you are in VB3, you have loaded the compatibility layer for Jet2.0, and you are using ODBC. In this configuration, the ODBC queries willalways run in asynchronous query execution

DevX - Software Development Resource

Prevent Errors When Using GetSetting

Using Visual Basic’s GetSetting function might cause an error, particularly in certain situations when using itunder 16-bit operating systems with INI files. If there’s no specific entry in the INI

DevX - Software Development Resource

The Mid Statement and Function

You’re probably familiar with the Mid function, which returnsa substring of a specified number of characters from its stringargument. But are you aware that Mid can also be used to

DevX - Software Development Resource

Debugging Events When They’re Acting Funny

Use Debug.Print “Entering event …” without breakpointsto trace events if they seem to act funny. Don’t use break points withMsgBoxes–they can alter the event sequence.

DevX - Software Development Resource

The Move Method is Faster

To move a control or form to a new location, you can set the Leftand Top properties to new values: frmCustomer.Left = frmCustomer.Left + 100 frmCustomer.Top = frmCustomer.Top + 50

DevX - Software Development Resource

Get Rid of Leading Zeros

Eliminate “leading-zeros” in a text string in this interestingway: instring$ = “00030” ‘ set the string with some leading-zeros’ now to get rid of them….instring$ = CStr(Cint(instring$))’ now instring$ should

DevX - Software Development Resource

Fading Colors

Use this as a fast way to paint the background of any form witha really cool “fading” color (lighter at top to darkerat bottom). To specify base color, pass True/False

DevX - Software Development Resource

Detect Null Or Zero-Length Fields In A Database

This syntax is much faster than using an If.Then.Else construct to detectnull or zero-length fields, and it will ensure that an error will not occur.For strings: Dim sVar As String.sVar

DevX - Software Development Resource

Center Forms Onscreen

I use this procedure to center my forms. With frmParent, the lastloaded form is centered against the parent form. Otherwise, it’scentered against the screen. I always center forms in the

DevX - Software Development Resource

When to Use SendKeys

Use the SendKeys function to exploit the delete functionalityof many grid and spreadsheet controls that have a delete functionality.Use this functionality without writing code to delete each rowif your form

DevX - Software Development Resource

For…Next Loop Speedup

Whenever you use For.Next loops, it is faster NOT to use the countername after Next (of the For.Next loop). In nested loops, it produces significantlyfaster code. Sub Form_Load ()Dim TStart!Dim

DevX - Software Development Resource

Logging User Activity with VB and Access

A while back, I wrote a simple orders application that allowedusers to query and update order information. The application workedfine, but lacked a user activity log. It was difficult for

DevX - Software Development Resource

Using Database Transactions

When you first start using the VB database functions, you might wonderwhy they call its engine JET–it seems to not fly. Using databasetransactions (search the online help for BeginTrans) might