Shortcut in Visual Studio 2010 to generate every possible case in the switch

I cannot find a key binding to extend all possible cases in the switch, for example. have a switch with an enum argument, in Borland C ++ I do this with the TAB key while the switch code is selected.

I want to do this in Visual Studio 2010.

Can anybody help me?

+6
switch-statement visual-studio visual-studio-2010 keyboard-shortcuts
source share
2 answers

This is C ++, it is impossible to do. The IDE simply does not support this operation.

In C #, you can do this with a switch snippet:

  • Type a โ€œswitcherโ€ in the IDE that selects the snippet in intellisense
  • Press Tab to insert a fragment that will move the cursor inside parens
  • Enter an expression to include and press Enter

This will extend the known cases in the IDE.

+15
source share

I had the same issue and it was a reinstallation duet that does it differently.

after entering the switch and parameter, place the cursor in the switch case, and then you need to click on the lamp icon on the left or press Alt + Enter.

0
source share

All Articles