Skip to content

Commit 66b6665

Browse files
committed
Only change form caption when caption is same as original name
1 parent 863cbbc commit 66b6665

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

RetailCoder.VBE/Refactorings/Rename/RenameRefactoring.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ private void RenameModule()
177177
}
178178
else if (module.Parent.Type == vbext_ComponentType.vbext_ct_MSForm)
179179
{
180+
if ((string) module.Parent.Properties.Item("Caption").Value == _model.Target.IdentifierName)
181+
{
182+
module.Parent.Properties.Item("Caption").Value = _model.NewName;
183+
}
180184
var codeModule = (CodeModuleClass)module;
181185
codeModule.Parent.Name = _model.NewName;
182-
module.Parent.Properties.Item("Caption").Value = _model.NewName;
183186
}
184187
else
185188
{

0 commit comments

Comments
 (0)