Skip to content

Commit 0eafa7f

Browse files
committed
Adds check to if a userform selected in Project Explorer has a designer that is topmost in MDI
If the user selects various components in Project Explorer, and then selects a userform, that component might already have an open designer that is visible and top-most in the MDIClient. If the designer is topmost, then set the status bar to the designer's control selection, otherwise use the component. If the userforms's code module is topmost, it has already been hit before we reach this check
1 parent b11039b commit 0eafa7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

RetailCoder.VBE/App.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ private void RefreshSelection(IWindow window)
142142
WindowKind windowKind = _vbe.ActiveWindow.Type;
143143
var pane = _vbe.ActiveCodePane;
144144
var component = _vbe.SelectedVBComponent;
145+
var activeMDI = _vbe.ActiveMDIChild();
145146

146147
Declaration selectedDeclaration = null;
147148

@@ -170,7 +171,9 @@ private void RefreshSelection(IWindow window)
170171
}
171172
else
172173
{
173-
caption = component.Type == ComponentType.UserForm && component.HasOpenDesigner
174+
caption = component.Type == ComponentType.UserForm
175+
&& component.HasOpenDesigner
176+
&& component.DesignerWindow().Caption == activeMDI.Caption
174177
? GetComponentControlsCaption(component)
175178
: String.Format("{0}.{1} ({2})", component.ParentProject.Name, component.Name, component.Type);
176179
}

0 commit comments

Comments
 (0)