Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 27-Jul-12 22:19pm
v2

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[^].
 
Share this answer
 
Comments
Member 9093981 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....
In C# there is no method to find keycode, however we can find it using javascript.

For dot(./Period) keycode is 190.
 
Share this answer
 
v2
Comments
Member 9093981 28-Jul-12 4:20am    
how to detect keyboard detection in C#
Mohd Imran Saifi 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900