I want to "find all references" to a control on my windows form (in designer mode). This is the painful procedure I currently use:
I wonder if I miss something or there is really no way to perform such operation in simpler ways. Also I recently installed Resharper (for sake of other features).
Please tell me if there is any built-in way in VS or any methods provided by Resharper or its plugins to ease such operation,
I use VS 2010 SP1 C# and Resharper V7.0.
EDIT: It is much appreciated to mention whether your whole proposed solution or portions of it are based on VS, or Resharper when answering. (Because I installed Resharper very recently and not gone deep in its features yet), thanks a lot.
Acknowledge & Conclusion: Thanks to thersch: His answer is like a full-article and very informative for community. Thanks to wal: He pointed two delicate tips (sorted-list view, skipping name look up). Thanks to both of you: You complemented the missing parts together.
Current Status: I reported the issue to developement and have requested this as a feature to be implemented in later versions of the resharper, visit the link below for tracking the current status of the issue from the tool vendor :
https://youtrack.jetbrains.com/issue/RSRP-429747
DISCLAIMER: I have no affiliation with the tool / vendor, just a user.
Again in detailed steps:
Assumed you have open the Design View of a forms control (MyControl.Designer.cs
).
F7
(You don't need to select control before.)
=> Code file MyControl.cs
is open.
Set cursor on control's class name by:
Shift+F12
=> lists all usages
Shift+F7
=> switches back to Design View
or
If you have already File Structure window (Ctrl+Alt+F) open (I have it always open.) switch to code view by F7, click there control's class name and press Shift+F12.
Again in steps:
Assumed you have open the Design View of a forms control.
F7
(You don't need to select control before, just have focus on Design View window.)
=> Code file MyControl.cs
is open.
Open File Structure window (Alt+Ctrl+F)
Select control in File Structure window by:
Shift+F12
=> lists all usages
Shift+F7
=> switches back to Design View
VS: F7, Shift+F7
ReSharper: Ctrl+[, Shift+F12, Alt+Down, Alt+\, Alt+Ctrl+F
I don't think you need step 2) Goto the "Name" in the property sheet
You can just click on the property and its name will be shown in the top combo box.
Assuming you have Resharper installed and you have selected the control in the designer you can then do the following:
1) F7 (go to code)
2) Alt + \ (List members alphabetically, start typing in this dialog to filter or scroll to the one you want, you dont need to type the complete name)
3) Shift-F12 (once youve made a selection from step 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With