When using CodeRush/Refactor Pro, I can use my mouse to toggle a context menu to change the scope of a member. By default, pressing CRTL+' doesn;t toggle this menu.
Is there anyway to achive this using a keyboard shortcut? A soltuion involving CRTL+' would be ideal.
You can toggle the scope using ALT + up/down arrow
Place the caret inside the method or on the same line and try it. DevExpress offers a shortcut cheat sheet here that you might find useful.
Related
Currently I used this snip code as a result from googling.
var eventArgs = new TextCompositionEventArgs(Keyboard.PrimaryDevice,
new TextComposition(InputManager.Current, Keyboard.FocusedElement, "A"));
eventArgs.RoutedEvent = TextInputEvent;
var flag = InputManager.Current.ProcessInput(eventArgs);
It was working if I used Keyboard.Focus(TxtBox); and the TxtBox will be filled with the Keystroke.
But what I want really achieved is:
1.Drawing a box (for example, I draw box on one of the excel cell)
2.Click on the box coordinate (to change Keyboard Focus)
3.Send Keystroke to clicked excel cell
I have done step 1 and 2.
But I can't find a way to do the third step.
Somehow, the click event (using mouse event) maybe not changing Keyboard Focus automatically.
So, how do I change Keyboard focus, if possible using coordinate ?
Or maybe can I get IInputElement from a coordinate ? and then set keyboard focus to it.
Of course, all of it outside from the main application window of the WPF.
Found it !
At:
Installed InputSimulator via NuGet, no members accessible
It is working in most cases.
I said in most cases, because it is able to type in other window like excel application, but on other custom app window. There might be a case it won't work.
Hope it help for other people, looking for the same thing.
When debugging in Visual Studio 2015, after jumping from a reference of an identity to its definition, can I jump back from the definition to the previous reference?
Thanks.
Yup. There is a "Navigate backwards" command that will do what you want.
You can see where it is for me and it is part of the "Standard" shortcut bar. It can also be found under the "View" menu or the keyboard shortcut is ctrl+-.
You could try Cntrl + -.
This would bring you to the last position of the cursor.
The original Answer is here
Did I get you right?
For more information on navigation by shortcuts this post is quite helpfull
Assuming that you have been doing things in sequence, you can Navigate Backwards
Keyboard Shortcut
Hitting Ctrl + - (Ctrl and minus at the same time)
Visual Studio Toolbar GUI
Alternatively, you can also do this by hitting the back button on the toolbar
Mouse Shortcut
Lastly, the "3rd" mouse button if you have one, usually on the left side. (The same mouse button that gets your browser to navigate backwards)
Once code has been written, the only way I know of to view the overloads for a method is to actually edit the method by deleting the Parenthesis () and reopening them.
Is there a shortcut key that I could press to activate this instead of having to edit my files?
For an example, please reference the ShowDialog Overload screen shot below:
With your cursor inside the parentheses, use the keyboard shortcut Ctrl-Shift-Space. If you changed the default, this corresponds to Edit.ParameterInfo.
Example:
Ctrl+Shift+Space shows the Edit.ParameterInfo for the selected method, and by selected method I mean the caret must be within the method parentheses.
Here is the Visual Studio 2010 Keybinding Poster.
And for those still using 2008.
Tested only on Visual Studio 2010.
Place your cursor within the (), press Ctrl+K, then P.
Now navigate by pressing the ↑ / ↓ arrow keys.
The default key binding for this is Ctrl+Shift+Space.
The underlying Visual Studio command is Edit.ParameterInfo.
If the standard keybinding doesn't work for you (possible in some profiles) then you can change it via the keyboard options page
Tools -> Options
Keyboard
Type in Edit.ParameterInfo
Change the shortcut key
Hit Assign
It happens that none of the above methods work. Key binding is proper, but tool tip simply doesn't show in any case, neither as completion help or on demand.
To fix it just go to Tools\Text Editor\C# (or all languages) and check the 'Parameter Information'. Now it should work
Great question; I had the same issue. Turns out that there is indeed a keyboard shortcut to bring up this list: Ctrl+Shift+Space (a variation of the basic IntelliSense shortcut of Ctrl+Space).
The command Edit.ParameterInfo (mapped to Ctrl+Shift+Space by default) will show the overload tooltip if it's invoked when the cursor is inside the parameter brackets of a method call.
The command Edit.QuickInfo (mapped to Ctrl+KCtrl+I by default) will show the tooltip that you'd see if you moused over the cursor location.
I know this is an old post, but for the newbies like myself who still hit this page this might be useful.
when you hover on a method you get a non clickable info-box whereas if you just write a comma in the method parenthesis the IntelliSense will offer you the beloved info-box with the clickable arrows.
Every once and a while the suggestions above stop working, if I restart Visual Studio they start working again though.
you mean's change overload.
just Press Shift + ↑ / ↓
Mine showed up in VS2010 after writing the first parenthesis..
so, prams.Add(
After doings something like that, the box with the up and down arrows appeared.
I would like to be able to programmatically emulate the keyboard
navigation for dialog boxes.
I have a custom hardware device with a keypad that I would like to use for
dialog box navigation.
I know about Focus(), but I'd rather do something that automatically
respected the tab order. By emulating the keyboard navigation I don't
have to worry about re-inventing complex behavior for each type of
control.
Does anyone know how to do this?
Thanks!
For Winforms, you want want the Control.GetNextControl() method
For WPF, you want the UIElement.MoveFocus() method
In Winforms:
Control nextControl = this.GetNextControl(myControl, true);
To simulate a tab press, I believe it's the following:
SendKeys.Send("{TAB}");
You could use P/Invoke to call the Windows API function keybd_event to simulate pressing the Tab key.
Bonus: you can use your device to enter tabs into a text editor as well! ;)
I want the 'Alt' to be pressed by code. It is like firing key-press event with key 'Alt' by the code, not hitting it manually. The need is, I have set 'ShortCut keys for menu, but it (the single underline on key letter) is not visible to the user unless he presses 'alt'. So i need to make the Alt be pressed by default.
Is there a way to 'press' or 'fireup' the keys in key board using c# code?
Check out the System.Windows.Forms.SendKeys class.
You can use the static Send method to send keystrokes to the active window. If you're trying to send keystrokes to another window, you'll need to use the Windows API to activate the other window first.
If you have any control over the operating system on which the program is being deployed, apparently you can force the underlined shortcut letter to always be displayed by going to Control Panel -> Display -> Appearance -> Effects -> Hide underlined letters for keyboard navigation.
(http://www.chinhdo.com/20080902/underlined-letters-windows/)
here is a complete article on use of SendKeys on codeproject
Here is how you simulate input (both mouse and keyboard).
http://msdn.microsoft.com/en-us/library/ms171548.aspx
If you look at the System.Windows.Forms.SendKeys class you will see that it provides you with what you want.
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx