REPRODUCTION:
You will see a dialog to rename the Frame and not the TextBox.
HYPOTHESIS:
When selecting control items the parent frame appears to be selected in the GUI at all times.
It is not possible to select a control child of a frame without the parent frame also being selected.
SOLUTION BASED ON THAT HYPOTHESIS:
If SelectedItems.Count > 1 Then
' Oh noes
End If
OPTIONS:
We could For Each through the selection
OR
ask the user to clarify which object should be renamed
OR
Display a rename dialog with all of the selected items on different lines with If no change then ignore.
I like the "pop a dialog and prompt to confirm" option, but only if it's not possible to determine the specific deepest non-parent control that's selected. I do think we should be able to recursively locate the actual selected control though.
For info with this issue, renaming the relevant object from the the event handler code, works correctly - it pops a message to ask if you want to rename the control instead of the event handler - so this can be used as a work around for the time being.
Most helpful comment
For info with this issue, renaming the relevant object from the the event handler code, works correctly - it pops a message to ask if you want to rename the control instead of the event handler - so this can be used as a work around for the time being.