Solved

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

Posted on 2007-03-31
4
921 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 143

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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