March 13, 1999

Applying CSS Styles Across Your Entire Site

Using Cascading Style Sheets (CSS), you can easily create styles that apply to the entire site. This technique has many advantages over repeating the same style text over and over

Hashtable Key Replacement

Most Java programmers know that adding an object to a Hashtable using a key already stored in the Hashtable will cause the previously-added object to be “dropped” from the table

Prefer Initialization to Assignment of Objects

In general, assignment requires the creation and destruction of a temporary object, whereas initialization does not. This is true for not just for strings, but for every object type, so

Simulating Virtual Constructors

A constructor may not be declared virtual. The easiest way to simulate virtual construction is by defining a virtual member function that returns a constructed object of its class type:

Member and Non-Member Overloaded Operators

Most of the overloaded operators can be declared either as non-static class members or as non-member functions. In this example, operator == is overloaded as a non-static class member: class

Create Automatic Hourglass Cursors

If you create an ActiveX control that uses a custom MousePointer property, place the control on a form, and at run time change the Screen.MousePointer property to an hourglass. You’ll

Translate Color Values

With the RGB function, VB provides a neat and valuable tool for converting separate Red, Green, and Blue values into a single Long color value.. However, VB won’t let you

Extend Intrinsics in UserControl Wrappers

Sometimes you might want to create autoselecting combo boxes, like those in Intuit Quicken or Microsoft Access, where items in the list are selected as you type. Typically, techniques to

Provide Status Messages for Menus

Subclassing a form lets you give a helpful message whenever a user highlights a menu item. Use the Caption property to identify the menu item, then display the help message