You are here: AxTools > CodeSMART 2007 for VB6 > Documentation > User's Guide > Designer Tools > Change Name and Text Properties
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

Change Name and Text Properties

When you design a user interface item, besides modifying the positions and sizes of the contained controls you often need to change the name and more probably the visible text (caption). Unfortunately there is no direct way to modify these properties into Visual Basic designers, so you have to use the Properties window. Search for the Name property and perform the changes, search for the Text or Caption property and also make the necessary changes - you might find it all very awkward and inconsistent, especially when you have several controls that need to be modified. Not to talk about the cases when your coding standard requires a synchronization between the name and text properties - for example a label with the caption "Customer Address" should have the lblCustomerAddress name.
In such cases CodeSMART can help with the Change Name and Text Properties feature. This dialog enables the developer to update (for the currently selected control) both the Name and Text properties and even to perform automatic synchronization between them.

Changing the Name and Text properties of an existing control:

  1. Right-click on a control displayed in a Visual Basic designer.
  2. Select Change Name and Text Properties in the displayed popup menu. A special dialog box appears containing the control's name and the eventual control text. If the control has a Caption property instead of a Text one this will be used by CodeSMART. Please note that for custom (user, third-party) controls the menu entry may not appear in the popup - in such cases you can use the toolbar button that is available in the Designer Explorer.
    Change Name and Text Properties
  3. Use the corresponding text-boxes to change the control's name and/or text.
  4. Select the AutoFill options in order to have the other property value automatically updated based on the currently edited one.
  5. In case you choose not to automatically update the other property, you can use one of the two link controls in order to perform a manual synchronization as follows:
    • Name from Caption: updates the control name based on the just entered control caption/text. Words appearing in the control's caption are capitalized and concatenated while spaces are removed. The name is preceded by a prefix or terminated with a suffix according to the current naming standard settings for control variables.
    • Caption from Name: fills the control caption/text based on the just entered control name. Spaces will be generated if a control is in camel case or title case in order to separate the composing words.

  6. For Name property generation based on the Caption property value, you may additionally specify another two options when clicking on the Options button:
    • The maximum number of words from the Caption property string used to generate the control name.
    • Whether or not carriage return characters should be converted into underscores when generating the Name property.

  7. You can use the Standards button to change the current naming standard settings for control variables.
  8. Click OK to update the control's Name and Text/Caption properties.

Changing the Name and Text properties of a newly created control:

    You can change the Name and Text properties not only for existing controls, but also for newly created controls. CodeSMART can intercept the control addition operation and ask for a Name (pre-filled based on the current control naming standards) and Text/Caption (if applicable).

    To turn this feature on you must check the Enable the New Control Spy option in the Designer Tools section found in the CodeSMART Control Panel.
See Also

Designer Tools Overview
Tab Order Designer
HotKey Designer
Bulk Controls Renamer
Property Tips
Control Cloning Tools

Back To Top

Copyright © 2008 AxTools - CodeSMART 2007 for VB6 - Designer Tools