August 13, 1999

React to Font-Changed Events

Use WithEvents to perform an action when you change any font properties of a specific control or form. Make sure you set the OLE Automation reference in the References dialog: ‘ Declaration sectionPrivate WithEvents fntAny As StdFontPrivate Sub fntAny_FontChanged(ByVal _ PropertyName As String) Select Case PropertyName Case “Name” ‘ Perform

Q&D Sort Using Hidden List Box

VB has no built-in Sort function. Although lots of sort routines of varying complexity and performance are available, there’s a simple “cheat” that you might find useful. The standard VB ListBox control has a Sorted property. Anything you add to a list box will automatically be placed in its proper

Toggle Listview Headers Between Flat and 3-D

Whenever you want a ListView control with flat, nonclickable headers, use this code to toggle the header style. Flat headers don’t give users the impression of sortability that 3-D headers do: Private Declare Function GetWindowLong Lib _ “user32” Alias “GetWindowLongA” (ByVal hWnd _ As Long, ByVal nIndex As Long) As

A Generic Routine to Fill Unbound Lists

A common need in database processing is retrieving a list of the values of a particular column field for every record in a table. This function takes arguments for a database name, table name, field name, and optional SQL criteria string, and it returns a collection that contains the list

Consolidate Global Data

We all know that using global variables in our projects is not considered good programming practice. Nevertheless, everyone does it. Sometimes you need to introduce public variables for storing initialization (INI) file names, Registry keys, shared constant values, and other common needs. Well, you can consolidate all your public variables

Speed Up Download Time

Question: How can I speed up the download time of the text and images on my company’s Web site? Is there any rule of thumb to go by? Answer: The rules of thumb for speeding downloads from a Web site are similar to the rules for speeding applications in non-Web