Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010: Keyboard Shortcut to "Override Method" in C#?

In Visual Studio 2010, what is the keyboard shortcut to drop-down a list of C# virtual methods, and clicking them will generate an "override method" code?

In IntelliJ IDEA, that feature's shortcut is CTRL+Shift+O.

like image 418
thenonhacker Avatar asked Jun 02 '11 10:06

thenonhacker


People also ask

How do you override a method in Visual Studio?

Type override in C# or Overrides in Visual Basic, followed by a space, where you would like to insert an override method. Select the method you want to override from the base class. to show or hide properties in the list. to show or hide methods in the list.

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.

How do you override a VS Code?

You can do Ctrl + Mouse left click to open that class, there you can see all the function that you can override. I simply do copy paste of that function and change the function body.


2 Answers

If you type overridespace, or just ovtabspace you will get this list. Select the one you want tab and it will generate the full override signature and place you in the body (the caret will be placed immediately before the base.blah(...) call it generates).

like image 127
Marc Gravell Avatar answered Oct 13 '22 02:10

Marc Gravell


Generally intellisense will automatically list after you've typed (or used intellisense to complete) override.

Typing a space after the "e" of override will get the list again.

like image 41
Richard Avatar answered Oct 13 '22 03:10

Richard