September 11, 1999

Quickly clear a portion of an array

The fastest way to clear an array is to ReDim (if the array is dynamic) or Erase it (if the array is Static). However, if you want to clear a portion of an array, it seems that you must code a For-Next loop.If you are dealing with numeric arrays, there

Suppress TreeView’s tooltips

By default, all TreeView controls whose version number is 4.70 or higher display the text of the node under the cursor if the node itself isn’t completely visible. You can turn off and on this feature by resetting a bit in the control’s style, using the following code: Private Declare

Highlight the contents of a control on entry

You probably already know that you can highlight the contents of any textbox by adding two lines of code in its GotFocus event: Private Sub Text1_GotFocus() Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text)End Sub This approach, however, fail shorts when you have dozens of textboxes on your form, and forces you

Build a simple browser for icons

Winodws uses a special browser to show all icons contained in a file and offers the end user the possibility to choose an icon from it. You can add this functionallity to your applications through an undocumented API function, SHChangeIconDialog. Its Declare is: Declare Function SHChangeIconDialog Lib “shell32” Alias “#62”