0

I would Like to add to my Visual studio a shortcut or addin to add fixed text to the position where the cursor is on. For example : this is my current cs File:

public void foo(){
int x = 4 ;
**cursor Position**
}

when the shortcut or the addin triggered the code will be :

public void foo(){
int x = 4 ;
'my fixed text'
}

Thanks

4
  • Have you considered snippets?
    – CesarGon
    Commented Oct 20, 2016 at 9:42
  • I dont know this tool.. can youe give me details or example? Commented Oct 20, 2016 at 10:09
  • Check this out: msdn.microsoft.com/en-us/library/z41h7fat.aspx
    – CesarGon
    Commented Oct 20, 2016 at 11:10
  • I look it and its good but I have mistake i need something else. I will try to explain again what I need : (1) i need to create hotkey for openning a form that I created. (2) from this from I need to take text and need to write him into the cs file on the cursor position. the text from the form is not fixed. Thanks. Commented Oct 20, 2016 at 12:07

1 Answer 1

-1

I would recommend Autohotkey for this. Just save this is a .ahk file and it will work as intended:

c::
  SendInput, The text you need pasted
Return
1
  • 1
    I recommend AutoHotKey. However, The question is not about how to accomplish this goal, but how to accomplish it in C# language. Commented Dec 9, 2016 at 0:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .