Tip Bank

DevX - Software Development Resource

Toggle Boolean Values Using Not

To toggle a variable between True and False, use the Not operator insteadof an If statement. Use the Not operator on those variables you have explicitlyset with the True or

DevX - Software Development Resource

Editing Grid Cells

Grids provide a nice way to present certain types of spreadsheet information.Unfortunately, the grid in VB does not allow editing. With just a littlebit of code you can simulate editing

DevX - Software Development Resource

VB Assist Quick Tips

Using the AutoSave feature in the VBAssist Options box automaticallysaves changes made to your project after a defined time interval. To temporarily bypass VBAssist’s Control Lock feature, hold down theCtrl

DevX - Software Development Resource

Setting Tab Stops in List Boxes

To quickly set tab stops in list boxes, use the SendMessage API call.The units used are called Dialog Base Units, which average out to aboutfour per character. Some experimentation is

DevX - Software Development Resource

Use the Controls Collection

If you need to reference every control on a form, using the Controlscollection will be faster than referencing every control directly. Forexample, if you have four command buttons on a

DevX - Software Development Resource

Preventing “Invalid Use of Null” Errors

If your app uses database or other functions that can return Null variants,your app will crash sooner or later with that dreaded “Invalid Useof Null” error. Preventing it is simple:

DevX - Software Development Resource

In-Line Code

Calling a function or procedure incurs some overhead. If you have atwo-line function that is called from only three places, you might considerputting those three lines in the functions themselves

DevX - Software Development Resource

Use Specific Object Types

When passing controls as parameters, make the function that is receivingthe parameter accept the specific object type instead of generic types.The exception to this is when multiple types of objects