October 24, 1998

Swing, Buttons in Buttons

Tired of the same old buttons? My car radio has buttons in buttons, and you can do the same with Swing. Swing components are also containers which can contain other components. To illustrate, this program places two buttons and a label in a third button. All three buttons can be

How is Virtual Inheritance Implemented?

When multiple inheritance is used, it is sometimes necessary to use virtual inheritance. A good example for this is the standard iostream class hierarchy: //Note: this is a simplified description of iostream classesclass ostream: virtual public ios { /*..*/ }class istream: virtual public ios { /*..*/ }class iostream : public

Code-Commenting Shortcuts

Instead of going to the Edit menu to comment out a section of code, you can add the comment command to the shortcut menu you access by right-clicking in a code window. Select View/Toolbars/Customize. On the Toolbars tab of the Customize dialog, click on the “Shortcut Menus” check box. On

Is My Object Valid?

Have you ever needed to determine if an object variable is holding a valid reference? TypeName() returns a class name if the object holds a valid reference. It returns the word “Nothing” if it does not: Public Function IsObjValid(objTest As Object) As Boolean Dim vntResult As Variant vntResult = TypeName(objTest)

Run Your VB App on Startup

Do you have an application you need to launch on Windows startup? Typically, you do this by placing an item in the Startup directory. However, you can also do this with a registry entry. Add a new string value using the name of your application. The value is the path

Providing an “Insert Object” Dialog for the RichTextBox

One of the enhancements to the RichTextBox control in VB5 is the addition of an OLEObjects collection, which allows Rich Text documents to include linked or embedded OLE objects. However, the RichTextBox control provides no interactive way for users to insert such objects; they must be added by means of