GUI Object Properties

Normally, name.property = value

All user interface components which are used in your code should be named with something like unique_UIType or UIMenu_Level1_Level2. The menus and toolbar objects should have the type first so that they will sort together. The rest sort alphabetically on the unique identifier name.

Static components which are not referenced via code should keep their default names.

Visual Basic | Delphi | C++ Builder | Java | Others


Visual Basic 6.0

VB is not case sensitive
  Status_UITextBox.ForeColor = vbRED 'set the color
  Status_UITextBox = "red"           ' set the text property
  Status_UITextBox =    5            ' set the text property

  With commondlg      
    .HelpFile = "filename.chm"      
    .HelpCommand = &HB 
    .ShowHelp
  End With

Control Arrays

When you use the standard Windows Copy and Paste to copy an object, you will get a dialog box asking if "you want to create a control array?" If you answer no, the copy will have a unique name; if you answer yes, both objects will have the same name and the index properties of both the original and the new copy are assigned unique values.

Because the index property identifies specific objects in the array, it is required for all references to the array. Likewise, because it does not exist for regular objects, references to them do not allow it.

The following references a property. When compiling an event, if the presence of the index parameter does not match the object definition, you will get the following error message

The same error message is displayed if the value of the index property is deleted and the index parameter is left in the event definition, or vise versa.

Warning: When you place the cursor on a button's index property and press F1, the help refers to objects in a collection (a completely different concept). Following this thread leads to multiple dead ends.


Delphi

Delphi is not case sensitive The use of with is not as clear as in VB because the leading dots are not used to indicate which parameters are part of the object. This causes significant confusion. If a component needs to reference another component on the form, You can try this


C++ Builder

C++ is case sensitive

Does not have a with construct


Java

There are no static objects in Java - every object needs code to set it's parameters.


Others

MS Access is a little strange - you must select an object before you can read or write its properties.


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Languages / ObjectProps.htm