Home Articles My Account Messages Tools Join
Tech Blog, ASP.Net, VB.Net, C#.Net, Programming Help, Help Guide
StellarPC.com | Pressing Ctrl+Y deletes a line instead of Redo Fix (VB.Net)
Pressing Ctrl+Y deletes a line instead of Redo Fix (VB.Net)
Written by: Justin Rich

Pressing Ctrl+Y deletes a line instead of Redo Fix

When you first load Visual Studio on your computer, you are given an environment selection by default to choose from. If you're a VB programmer, the likelyhood is that you chose Visual Basic on the environment list rather than just choosing default. This causes the interface to revert to the way Undo & Redo were handled in VB6 which ironically was not Ctrl+Z and Ctrl+Y. Ctrl+Z certainly does undo, but it looks for Shift+Alt+Backspace for the Redo command. For those of us who are familiar with all other Windows programs like Office, we automatically hit Ctrl+Y to Redo when we undid too much. This poses a problem in Visual Studio under the VB environment because when you accidently try to Redo with Ctrl+Y, it deletes the current line entirely (formerly called Yank Line). Unfortunately, once you've done that, you've lost your entire Redo sequence and will have to retype everything.

To fix this, you simply go to Tools -> Options -> Environment -> Keyboard and set the keyboard mapping scheme to (Default) instead of Visual Basic. Click the Reset button and it takes effect immediately. You can then use Ctrl+Z and Ctrl+Y like all other Windows applications. There are probably some other mappings that change because of this, but I'm not sure which ones. It's possible to have been programming on this setting for months or years without noticing any differences besides the Redo command.
New Post Next 50 | Previous 50
Post# Subject: Posted By: Time:
New Post Next 50| Previous 50