Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

period or comma on numeric pad of keyboard

Status
Not open for further replies.

jamsek19

Programmer
Feb 4, 2002
35
SI
Hello.
I make a VP application, which use localization settings (sorting, numbers, ...).
I want to determine, what should I get period or comma (for example) in TextBox, if I press period key on numeric pad.
In english keyboard I got <.> and on my language I must get <,>.
Can anyone help me?

Thanks

Andreo
 
Return the national settings from the registry (see faq222-92) or use

mid$(2, CStr(1 / 2), 1)

to return the separator. Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
This is true just in case if you want to determine what is saved in registry. But if I switch between keyboard layouts &quot;on-line&quot; (by clicking in system tray icon) I do not get the right character (if is <.> or <,>).
Andrej
 
jamsek,

I don't think you want to go and programmatically change the keys. If your program ends improperly it could leave it that way and the user would be less than happy with you.

What you can do instead, is if it is a specific text box that you are looking in, add this code.
[tt]
Private Sub Text1_Keypress(KeyAscii as Integer)
If KeyAscii = 46 then ' This is a period
KeyAscii = 44 ' Change it to a comma
End If
End Sub
[/tt] Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Thanks for really fast reply.
Yes, I can use this if I have a TextBox or any object, where I should enter a number.
But is it possible to determine in advance what will I get if I press period key on numeric pad.
Thanks
Andrej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top