Tip Bank

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

Choose Compares Carefully

A straight ASCII compare, such as ‘F “A” < "B"THEN' is much faster then using VB's StrComp("A", "B",1). However, when you use this test to sort an array of strings,