devxlogo

Tip Bank

Combine Default with Other Attributes

When building an ActiveX control, you can set a default property or method using the Procedure Attributesdialog box, after clicking on the Advanced button. However, if your default property also

AutoSelect Text Box Contents

Users often find it faster to retype the entire contents of a text box rather than position the cursor within the data, and then edit the data. This is especially

More Versatile Array Parameters

You can write a single procedure that accepts any type of array as an argument by using a variantparameter. Within the procedure, address the array using the usual syntax: ‘

Easy CR/LF Padding

When I write text in message boxes, labels, and so on, and I need to include a carriage return/line feed, I use this function, passing it the number of CR/LFs

The Address of a Variable

THE ADDRESS OF A VARIABLEVB5 includes a built-in VarPtr function (see tip “Use the Object Browser to Discover UndocumentedFeatures”), but this function isn’t available in VB4. The VB4 runtime library

Cross Midnight Benchmarks

Traditionally, VB programmers benchmark their code using the Timer function. However, if your processmight terminate on the following day, you must take into account that the value returned by that

App.Path Might Return UNC Path Specifications

Unlike VB4, VB5””””s App.Path property might return a UNC path, such as “\serverprograms…”), undercertain circumstances, depending on how the program started and if it””””s interpreted in the VB IDE orcompiled