The information in this article applies to:
SUMMARYYou might think that you could change the letter case of a control name by changing the value of the Name property of the control in the Property Browser, or by using the Edit/Replace feature to find and replace all instances of the control name. However, the first method does not work at all if you have existing code, and the second method does not work in all cases either. This article shows you how to use a combination of methods to accomplish the change. MORE INFORMATION
This article describes three methods to change the case of control
references in code:
Rename the ControlThis method works only if you have made no references to the control in your code. Once you make any reference in code to a control, the editor remembers the control's name and case. Changing the case of the control name after this point does not affect existing or new code.Find and ReplaceYou can use the Edit/Replace feature to find and replace all instances of the control name with the new case.NOTE: This technique does not work in every case. When you add new event procedures, the old case is used. When combined with the next technique, you can change the case of all existing and new references to the control. Temporarily Dimension a VariableThe editor is designed so that all references to a variable name use the same case as the statement in which the variable is dimensioned.For example, type the following inside a code window:
To change the letter case of a variable, you must change its letter case
within the dimension statement. In the previous example, to change
MyVariable to Myvariable, alter the first line to:
You can take advantage of this feature to change the letter case of a
control's name. Just dimension a variable of the desired name and case.
After you press ENTER, the case will change throughout the code window.
Then simply delete the unnecessary dimension statement.
NOTE: This technique does not work in every case. It does not change the name of existing event procedure names because they are a compound name. However, new event procedure names will reflect the new case. When combined with the previous technique, you can change the case of all existing and new references to the control. ExampleThe following steps show how to change the case of Command1 to command1 by using a combination of the second and third techniques:
Additional query words: kbdse kbDSupport kbVBp kbVBp500 kbVBp600 kbVBp400 kbCtrl
Keywords : kbGrpVBDB |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |