Generated Button Names
When new buttons are created, by default the buttons are automatically given a sequential name composed of the button number (relative to the number of buttons already created in the project). However, TPD5 goes further in automatically generating a descriptive name for the button, based on the text and/or bitmap applied to the button:
- If you apply text to the button, the button text is substituted for the button number. For example if you create a new button (which is automatically named "Button 9"), then add the text "Welcome", note that the button is automatically renamed to "Welcome". Note that this name change occurs on the fly, and does not require a Save operation.
- Text on a button always overrides the presence of a bitmap. If there is text associated with a button, and you add a bitmap, the button name will not change. However, if the button has no text, when you apply a bitmap to the button, the button is automatically renamed to reflect the bitmap file name (i.e. "Background").
- Note that if you change the text, the button is again renamed to reflect the updated text. Furthermore, any time you change the bitmap or the text on the button, the button name is automatically updated with either the latest text or bitmap assignment.
This is where the Lock Button Name option (General tab of the Properties window) comes into play. By default, the Lock Button Name option is set to Off. At any point in the design process, click Lock Button Name and select Yes to prevent the button from being automatically renamed by the program when you edit the text or bitmap assignment(s). However, Lock Button Name does not prevent you from manually renaming the button, via the Name field.