August 21, 1999

Quick Property Edits

When you are placing controls on a form at design time and wish to edit one of its properties, the quickest way to switch to the Property window is pressing the Ctrl+Shift+key combination, where key is the first letter in the property name. For instance, to quickly modify the Caption

Use ActiveControl to stop a loop

Often your user interface includes fields whose contents mutually depends on other fields. A typical example is when you deal with conversions from one measurement unit to another. Let’s say that you want to let your users enter a temperature either in Celsius or Fahrenheit degrees, so you provide two

Use Currency instead of LARGE_INTEGER values

A few API calls require that you pass one or more LARGE_INTEGER arguments. These are 64-bit integer values, defined as follows: Type LARGE_INTEGER lowpart As Long ‘ lower 32-bit value highpart As Long ‘ higher 32-bit valueEnd Type Unfortunately, working with LARGE_INTEGER values in VB isn’t easy, because you have

Determine whether an API function is available

In many cases you may want to call an API function, but you aren’t sure whether the Windows version the application is running on supports that particular function.The easiest way to test whether a function exists and can be called is to replicate through VB code what Windows itself would

Remove collection items from the beginning

There are many different ways to delete all the items in a collection, but some of them are much faster than the others. Let’s start with a collection that holds 10,000 items: Dim col As New Collection, i As LongFor i = 1 To 10000 col.Add i, CStr(i)Next You can

Create a owner form with API functions

Starting with VB5, the Show method supports a second optional argument, that lets you specify which form owns the form that is about to be displayed: Form2.Show , Me A owned form is always displayed in front of its owner, and when the owner is unloaded, VB automatically unloads the