devxlogo

August 7, 1997

Streamline Your API Declares, Part 1

Most Windows API routines are functions and must be declared assuch, but in many cases we are not really interested in theirreturn value. The SendMessage function, for example, dependingon the

Double-Check Val Arguments

When using the Val function, VB has a quirk that causes a type mismatch error. For example, Val(“25%”)correctly returns 25, whereas Val(“2.5%”) misinterprets the string and returns a type mismatch

Showing “&” Character in Labels

If you want to show the character “&” instead of having it work as a marker for the access key, set theproperty “UseMnemonic” to False. This property is useful, for

Control Boxes And Close Buton

A form’s control box property usually controls both the system menu(control box) and the close button (X in the top right corner) on the form.If the ControlBox Property is set

A String Cleaner

At times it’s useful to have a function that cleans a string of unwanted characters. This small function acceptsthe string you want to clean and the characters you want to

Test Objects Using TypeName

You can determine the class of an object using the TypeName function instead of the If TypeOf statement.Use the TypeOf statement to determine the type of object: If TypeOf myObject

Limitation Of ImageList Control

Each image that is displayed in a TreeView or ListView control mustfirst be placed in an ImageList control. If many items are placed in thecontrol, it will run out of

Cool Commands for Your Help Menu

Most Windows applications include the following commands in the helpmenu: Contents Search For Help On… How To Use Help Although VB doesn’t provide direct support for these commands,they can easily