2

Could anybody please tell me shortcut for the Create - Property function of Visual Studio's context menu. I know that Create - Method's shortcut is CTRL + K + M, but I can't find similar shortcut to create property. Thanks.

D.P.
  • 230
  • 3
  • 11

3 Answers3

2

After some exploration, I've discovered that there is no default shortcut set for this command. It could be set in visual studio options dialog (Tools -> Options -> Environment\Keyboard) Command is called "Edit.GenerateProperty".

D.P.
  • 230
  • 3
  • 11
0

Please check following link

http://www.itscodingtime.com/post/Visual-Studio-2010-Keyboard-Mouse-Shortcuts.aspx

Hope, it might help you.

Edit: This topic is already discussed here Shortcut to create properties in Visual Studio?

Community
  • 1
  • 1
Jack
  • 193
  • 1
  • 14
  • It was similar question but not the same. Snippet is useful, but its a little bit different. Please, look at my comment to the LolCoder's answer. I've already checked that article, but didn't find answer. – D.P. Oct 03 '12 at 06:24
0

Type the prop and you can see prop in your intellisence and enter prop one....Then, you can change name of property with its type according to you choice(Default type is Type and default property naem is type) like in following way:

public TYPE Type { get; set; }

Another way of adding property is by pressing Ctrl + R, Ctrl+E when your cursor is around the field....

Akash KC
  • 16,057
  • 6
  • 39
  • 59
  • Thanks for your answer, but that is not what I'm looking for. Snippets allow me to generate property when I'm editing class itself, but then I write something like myObject.Property = "123"; and property is not defined in that object I may call context menu on "Property" and select Create -> Property, it will generate property string Property {get; set;} in myObject's class. I can do it using context menu, but it would be more comfortable for me to use shortcut to call this function. – D.P. Oct 03 '12 at 06:21