You know how in VS, when you put your cursor on a variable, it highlights all the variable occurrences? When I rename a variable, is there a shortcut to get VS to rename all the occurrences at once?
Solved! Go to Solution.
You know how in VS, when you put your cursor on a variable, it highlights all the variable occurrences? When I rename a variable, is there a shortcut to get VS to rename all the occurrences at once?
Solved! Go to Solution.
Solved by ActivistInvestor. Go to Solution.
Put the cursor on the variable identifier, and press F2
Put the cursor on the variable identifier, and press F2
...That doesn't seem to do anything for me. I tried putting the cursor in the middle of the var name, hit F2 and started typing, but it didn't do anything. It just put red squiggles under the other occurrences.
...That doesn't seem to do anything for me. I tried putting the cursor in the middle of the var name, hit F2 and started typing, but it didn't do anything. It just put red squiggles under the other occurrences.
It could have something to do with changing your key bindings.
On a default installation of Visual Studio, when I put the cursor on an identifier and press F2, I see this:
You can also right-click and choose "Rename" from the context menu.
It could have something to do with changing your key bindings.
On a default installation of Visual Studio, when I put the cursor on an identifier and press F2, I see this:
You can also right-click and choose "Rename" from the context menu.
@ActivistInvestor wrote:
You can also right-click and choose "Rename" from the context menu.
Oh, that one works. Nice! As for F2, I'm working from home right now on a laptop remoting to my work pc. Perhaps it's an rdp thing. I'll try F2 when I get back in the office.
edit: You gave me an idea. I went to options and found that it's command Refactor.Rename. My keyboard map (Default) is mapped to Ctrl+R. You're probably using VS pro. I'm using Community.
@ActivistInvestor wrote:
You can also right-click and choose "Rename" from the context menu.
Oh, that one works. Nice! As for F2, I'm working from home right now on a laptop remoting to my work pc. Perhaps it's an rdp thing. I'll try F2 when I get back in the office.
edit: You gave me an idea. I went to options and found that it's command Refactor.Rename. My keyboard map (Default) is mapped to Ctrl+R. You're probably using VS pro. I'm using Community.
Can't find what you're looking for? Ask the community or share your knowledge.