Solved

String "F5" to System.Windows.Forms.Keys.F5 ?

Posted on 2007-03-31
4
919 Views
Last Modified: 2008-01-09
Hello

How can I convert a string "F5" to System.Windows.Forms.Keys.F5 ?

For every string values that System.Windows.Forms.Keys is supporting?

Thanks

Sven
0
Comment
Question by:Ruttensoft
  • 2
4 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18829501
try this:
[Enum].Parse(GetType(System.Windows.Forms.Keys), "F5", True))
0
 

Author Comment

by:Ruttensoft
ID: 18829517
Ulalala what a masterpiece of code!

Thanks a lot, exactly what I wanted...
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 18829560
Just beware of the "quirky" vaues such as the numbers 1 thru 9.

They are "D1", "D2", etc...

Not very intuitive in my opinion!

0
 

Author Comment

by:Ruttensoft
ID: 18829567
Thanks Idle, just had that problem :-)
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question