devxlogo

Tip Bank

Doubling Quotes for SQL Statements

This routine parses a string and returns an equivalent string where all the instances of a given substring are doubled. This is especially useful for doubling quotes within SQL statements

Jump Back and Forth Among Procedures Quickly

My code often has a lot of nested procedure calls, which can be painful to trace while doing walk-throughs. Developers might be unaware of the “Procedure Definition” (Shift+F2) feature, which

Use Pictures on Command Buttons

To use a picture on a CommandButton, you must set its Picture property and set its Style to 1 – Graphical. Otherwise, the picture will be ignored.

Use VB System Color Constants in API Calls

Visual Basic includes constants, such as vbActiveTitleBar and vbButtonFace, for Windows system colors, which the user might change through the Control Panel. (In VB3, these constants are defined in the

Change Tooltips Background Color

To change the ToolTips background color, open the Control Panel’s Display tool. Click on the Appearance tab. In the Item combo box, select ToolTip. Click on the little color box

The Scope of A Local Loop Counter

C++ allows you to declare variables wherever you need them, thus enabling immediate initializations. A good example is a loop counter. It can (and should) be declared inside a for-statement: