Wednesday, May 11, 2011

Closing a modal dialog box

Problem: Visual Studio (and perhaps other programs) has an annoying habbit of sometimes displaying a modal dialog window when you are perhaps loading the solution or getting the latest version from Source Safe, which you can't click on. If you don't happen to have Visual Studio in focus when the dialog box appears, it can result in the Visual Studio grinding to a halt until you can close that dialog box. You can alt-tab to that window/dialog box, but you cannot click Yes/No/Cancel/Ok... arrrgh!

Solution: Alt-Tab to the dialog box and press Escape (ESC). Even though you can't click on the dialog buttons or use Enter or the spacebar, pressing Escape will cause the Cancel/No button to be clicked and allow you to continue on your merry way. Happy coding.