Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# C#4.0 .NET4 key
What is dot(.) key keycode in c#.net ???
 
I am taking floating point numbers input from a textbox. Only number inputs i can take, but i have to apply backspace and dot(.) keys....
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress(v=VS.90).aspx[^]
OR
http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx#Y0[^]
Posted 27-Jul-12 22:28pm
Edited 27-Jul-12 23:19pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try the OemPeriod keycode which is 190.
For a full list, go to http://msdn.microsoft.com/en-us/library/system.windows.forms.keys%28v=vs.71%29.aspx[^].
  Permalink  
Comments
Member 9093981 at 28-Jul-12 4:06am
   
I use the code of ur link... But,
 
// Determine whether the keystroke is a backspace.
if (e.KeyCode != Keys.Back || e.KeyCode != Keys.OemPeriod )

portion does not work. Please tell me the reason....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

In C# there is no method to find keycode, however we can find it using javascript.
 
For dot(./Period) keycode is 190.
  Permalink  
v2
Comments
Member 9093981 at 28-Jul-12 4:20am
   
how to detect keyboard detection in C#
Mohd Imran Saifi at 28-Jul-12 4:41am
   
there is no method to find keycode in c#

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 155
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411028.1 | Last Updated 28 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100