Making F1 Do Something Useful in Visual Studio

Have you ever wished that hitting the F1 key in Visual Studio actually returned good search results in a quick manner? 

Personally I think the F1 key returns decent results, but there certainly are a lot out there who don’t.  I mostly work in .Net so I’m in the camp of users that F1 works well for.

The think I really don’t like though is the 30 seconds or so it takes to launch the help window.  Once you’re there navigation is pretty painful.

For the last several years I’ve all but abandoned F1 and just search Google with “msdn” and my search term.  95% of the time this returns exactly what I want in the first hit.

Wouldn’t it be nice if we could make Visual Studio do this for us?  Well, we can, and have been able to for years!

Check out OriginalGriff’s solution on Code Project.  He clearly outlines the steps and I have to say his solution is quite nice and tidy.

However, I had two very minor criticism, purely for my own tastes.  This solution opens the webpage inside of Visual Studio’s web browser inside the IDE.  This works, but I really like using my own default browser (currently Chrome).  This allows me to open up various hits in several tabs and bookmark interesting solutions.  I can’t do that in the VS browser window.

Second is it grabs the selected text and performs the search on this.  If you don’t select anything it just opens up a search for “msdn”.  The original F1 functionality use to search whatever word your text cursor was on, nothing had to be selected.  I’m lazy and I like this ability.

Last, but not least, as I was writing this blog post and stated above that 95% of the time my search term came up in the first result it hit me. OMG If I think that what I want will be my first hit, why not just return Google’s first result; the equivalent of hitting the older I’m Feeling Lucky button on Google’s home page. If you look at Griff’s solution you will see below it that I proposed an alternate solution that adds these three features.  Now, when I hit F1 or Shift+F1 I, respectively, get the Google search or the first hit directly.

Enjoy!

When Bad UI Sticks Around – JavaScript Alert Boxes

We recently migrated from one online IEP vendor to another.  This is a program for collecting and managing Special Ed information, but it is an enterprise app and worthy of critique and comment.  They do a great job, but there are some small UI issues I wish could be fixed.

For instance, when you enter data onto a form and try to leave the form without saving they do a nice job of alerting you that you are about to lose the valuable data you just entered.  However, there is a catch:

SNAGHTML97e6ac4

Ouch, did you read that correctly?  “Hit CANCEL to Leave this page.”  The problem with that is I would say 99% of users are used to hitting Cancel when they realize they made a mistake and want to undo it.  Several times I’ve had to stop my knee-jerk reaction to hit cancel when I realized I updated something and didn’t hit Save.

Not only are the button actions inconsistent with what users are used to but I would go further and state they are actually opposite, which to me is one of the worst UI anti-patterns.  In addition the buttons are not very informative, OK and Cancel just don’t tell you what they are doing with your data.  Unfortunately I think it might be stuck as it is.  The software now boasts adoption of over half the state of California.  That’s a good sized client base and the current users are already conditioned to hitting OK to go back to the page and hit the Save button.  If the vendor were to reverse the impact of the buttons now I can just imagine the outcry there would be over users losing data because they are simply used to hitting OK.  You see, no matter how many emails, home page news alerts or training documents you give out half the users won’t even bother to read them.  They won’t know there is a change until they have already lost their data.  Not a good thing.

If I were to have to implement this change I would re-label the buttons all together.  This would not only alert the user that something functions differently then what they are used to but it would also make the dialog more usable, which is also a good UI pattern.  Unfortunately you cannot do this with plain JavaScript.  Since the vendor already makes use of jQuery the UI Dialog plug-in is a great tool to use.  It also standardizes the dialog boxes since JavaScript alerts are handled inconsistently between browsers.

Here’s a sample of what I would do using the jQuery UI Dialog plug-in.  I think it is easy to read and clear in informing the user on what they are about to do.  While this would be a change to what users are used to I think it would be one that is easily adapted to.

image