Convert to Constant
Purpose
Converts a variable or field into a constant. Constants are used to store values, which should never change. Use this Refactoring on fields or variables that do not and should not change.
Availability
Available when the cursor is on a field or variable declaration.
Usage
Place the caret on a field or variable declaration.
Note
The blinking cursor shows the caret's position at which the Refactoring is available.
private double │g = 9.807;
Private │g As Double = 9.807
- Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
- Select Convert to Constant from the menu.
After execution, the Refactoring adds the const modifier to the field or variable declaration.
private const double g = 9.807;
Private Const g As Double = 9.807
See Also
We are updating the DevExpress product documentation website and this page is part of our new experience. During this transition period, product documentation remains available in our previous format at documentation.devexpress.com. Learn More...