arrghh dot vs逗号 [英] arrghh dot vs comma

查看:68
本文介绍了arrghh dot vs逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨,,


i生活在欧洲欧洲的十进制分离器,而不是。

为什么如果我按下我的数字键盘。一个 。出现了吗?


在我看来应该是a,(听起来很奇怪,但应该是这样)


我的问题:


i工作目前在一个伙伴,人们使用数字

键盘输入数据我们正在重写cobol程序,,,在cobol你可以说

十进制分隔符=点或逗号,它将按预期工作。我们怎样才能
在.net中模拟同样的东西?

windows设置是否正确(荷兰设置),我们用标准工作

所有电脑上的qwerty国际键盘


所以我想要的只是数字键盘。将给出一个,如

这是键盘的数字分隔符号,。 (下面的那些<>

)应该像他们一样工作。


某人的想法???


问候


Michel Posseth

Hi ,,

i live in Europe in Europe the decimal seperator is , not a .
why is it so that if i press on my numeric keypad the . a . appears ??

in my opinion it should be a , ( sounds odd but ... it should be so )

my problem :

i work currently in a companny where people do data entry with the numeric
keypad we are rewriting a cobol program ,,, in cobol you could just say
decimal seperator = dot or comma and it would work as expected . how can we
simulate the same thing in .net ??

windows settings are correct ( dutch settings ) , we work with a standard
qwerty international keyboards on all computers

so what i would like is that only the numeric keypad . will give a , as
this is the numeric seperator symbol the keyboards ,. ( the ones below <>
) should work as they do.

someone an idea ???

regards

Michel Posseth


推荐答案

M. Posseth写道:
M. Posseth wrote:
嗨,,

我住在欧洲的欧洲十进制分离器,而不是。
为什么它如此我按下我的数字键盘。一个 。在我看来它应该是一个,(听起来很奇怪,但应该是这样)

我的问题:

我目前在一个公司工作,人们用数字键盘输入数据我们正在重写cobol程序,,,在cobol中你可以说
十进制分隔符=点或逗号它会按预期工作。我们如何在.net中模拟相同的东西?

Windows设置是正确的(荷兰设置),我们在所有计算机上使用标准的qwerty国际键盘

所以我想要的只是数字键盘。将给出一个,因为这是键盘的数字分隔符号,。 (下面的那些<>
)应该像他们一样工作。

某人的想法???

问候

Michel Posseth

Hi ,,

i live in Europe in Europe the decimal seperator is , not a .
why is it so that if i press on my numeric keypad the . a . appears ??

in my opinion it should be a , ( sounds odd but ... it should be so )

my problem :

i work currently in a companny where people do data entry with the numeric
keypad we are rewriting a cobol program ,,, in cobol you could just say
decimal seperator = dot or comma and it would work as expected . how can we
simulate the same thing in .net ??

windows settings are correct ( dutch settings ) , we work with a standard
qwerty international keyboards on all computers

so what i would like is that only the numeric keypad . will give a , as
this is the numeric seperator symbol the keyboards ,. ( the ones below <>
) should work as they do.

someone an idea ???

regards

Michel Posseth



有没有办法重新映射那个特定的密钥?


T


Is there some way of remapping that particular key?

T


我不知道这是否有效;也许压倒了按键事件?将

它还会产生副作用吗?


受保护的覆盖Sub OnKeyPress(ByVal e As

System.Windows .Forms.KeyPressEventArgs)


如果e.KeyChar ="。" c那么


将theNewEvent变暗为新的System.Windows.Forms .KeyPressEventArgs("," c)


MyBase.OnKeyPress(theNewEvent)


Else


MyBase.OnKeyPress(e)


结束如果


结束子


" ;墓" <至** @ technetcenter.com>在消息中写道

新闻:cB ****************** @ bignews4.bellsouth.net ..。
I don''t know if this will work; maybe overriding the keypress event? Will
it have side effects further on down the line?

Protected Overrides Sub OnKeyPress(ByVal e As
System.Windows.Forms.KeyPressEventArgs)

If e.KeyChar = "."c Then

Dim theNewEvent As New System.Windows.Forms.KeyPressEventArgs(","c)

MyBase.OnKeyPress(theNewEvent)

Else

MyBase.OnKeyPress(e)

End If

End Sub

"tomb" <to**@technetcenter.com> wrote in message
news:cB******************@bignews4.bellsouth.net.. .
M Posseth写道:
M. Posseth wrote:
嗨,,
我住在欧洲的欧洲十进制分离器是,而不是。
为什么如果我按下我的数字键盘。一个 。在我看来它应该是一个,(听起来很奇怪,但它应该是这样)
我的问题:
我目前在一个同伴工作的地方工作使用我们正在重写cobol程序的数字键盘进行数据输入,在cobol中你可以说
十进制分隔符=点或逗号它会按预期工作。怎么可以在.net中模拟同样的东西?
windows设置是正确的(荷兰设置),我们在所有电脑上使用标准的qwerty国际键盘
那么什么我想只有数字键盘。将给出一个,因为这是键盘的数字分隔符号,。 (下面的那些
<>)应该像他们一样工作。
某人一个想法???
问候语

Michel Posseth
Hi ,,
i live in Europe in Europe the decimal seperator is , not a .
why is it so that if i press on my numeric keypad the . a . appears ??

in my opinion it should be a , ( sounds odd but ... it should be so )
my problem :
i work currently in a companny where people do data entry with the numeric
keypad we are rewriting a cobol program ,,, in cobol you could just say
decimal seperator = dot or comma and it would work as expected . how can
we simulate the same thing in .net ??
windows settings are correct ( dutch settings ) , we work with a standard
qwerty international keyboards on all computers
so what i would like is that only the numeric keypad . will give a , as
this is the numeric seperator symbol the keyboards ,. ( the ones below
<> ) should work as they do.
someone an idea ???
regards

Michel Posseth


有没有办法重新映射那个特定的密钥?

T


Is there some way of remapping that particular key?

T





嗯,,,


计算器可以做到这一点并且擅长它


所以必须有一种方法可以让我们做到


i刚刚发现这个

http://www.theproblemsolver.nl/dotnet_faq.htm

###############
>
键盘输入数字值和逗号作为小数点分隔符

我经常得到的一个问题是如何获得与输入数字时相同的行为

Excel值。具有相同的行为我的意思是Excel

检测小数分隔符的当前用户设置并使数字键盘上的点

输入正确的字符。这只适用于数字键盘,键盘常规部分的点和逗号

保持不变。这样做很容易,但找到正确的位置并不是完全明显的,因为在大多数事件中KeyEventArgs或Message参数

无法更改或更改它们无效。正确的地方

这是控件的PreProcessMessage()函数。下面的代码确实是这样的,只需子类化一个TextBox控件并覆盖

PreProcessMessage()函数就完成了。


Public Overrides Function PreProcessMessage(_

ByRef msg As System.Windows.Forms.Message)As Boolean

if msg.Msg =& H102 Then

如果msg.WParam.Equals(New IntPtr(& H2E))_

AndAlso msg.LParam.Equals(New IntPtr(& H530001))那么

''按下数字键盘指向

如果

Thread.CurrentThread.CurrentCulture.NumberFormat.N umberDecimalSeparator =","

然后

''并且小数分隔符是'',''用于当前设置

''更改消息以输入逗号而不是指针

msg.WParam = New IntPtr(& H2C)

msg.LParam = am = New IntPtr(& H330001)

End If

结束如果

结束如果


''做默认动作

返回MyBase.PreProcessMessage(msg)

结束功能


###################


但这不适用于数据网格控件


aaarghhh


:-(


为什么有时候很容易让事情变得容易: - |


" tomb"写道:

Well ,,,

the calculator does it and excel does it

so there must be a way that we can do it to

i just found this

http://www.theproblemsolver.nl/dotnet_faq.htm

###############
Keyboard input of numeric values and commas as decimal separator
One of the questions I frequently get is how to get the same behavior as
Excel when entering numeric values. With the same behavior I mean that Excel
detects the current users setting for decimal separator and makes the point
on the numeric keyboard input the correct character. This is only done for
the numeric keypad, the point and comma on regular part of the keyboard
remain unchanged. Doing so is very easy but finding the right place is not
completely obvious as in most events the KeyEventArgs or Message parameters
cannot be changed or changing them has no effect. The proper place to do
this is the PreProcessMessage() function of a control. The code below does
just that, just subclass the a TextBox control and override the
PreProcessMessage() function and you are done.

Public Overrides Function PreProcessMessage( _
ByRef msg As System.Windows.Forms.Message) As Boolean
If msg.Msg = &H102 Then
If msg.WParam.Equals(New IntPtr(&H2E)) _
AndAlso msg.LParam.Equals(New IntPtr(&H530001)) Then
'' Point in the numeric keypad pressed
If
Thread.CurrentThread.CurrentCulture.NumberFormat.N umberDecimalSeparator = ","
Then
'' And the decimal separator is a '','' for the current settings
'' Change the message to enter a comma instead of a poin
msg.WParam = New IntPtr(&H2C)
msg.LParam = am = New IntPtr(&H330001)
End If
End If
End If

'' Do the default actions
Return MyBase.PreProcessMessage(msg)
End Function

###################

however this doesn`t work on a datagridview control

aaarghhh

:-(

why are things that should be easy sometimes so hard to acomplish :-|

"tomb" wrote:
M. Posseth写道:
M. Posseth wrote:
嗨,,

我住在欧洲的欧洲小数分离器是,而不是。
为什么如果我按下我的数字键盘。一个 。在我看来它应该是一个,(听起来很奇怪,但应该是这样)

我的问题:

我目前在一个公司工作,人们用数字键盘输入数据我们正在重写cobol程序,,,在cobol中你可以说
十进制分隔符=点或逗号它会按预期工作。我们如何在.net中模拟相同的东西?

Windows设置是正确的(荷兰设置),我们在所有计算机上使用标准的qwerty国际键盘

所以我想要的只是数字键盘。将给出一个,因为这是键盘的数字分隔符号,。 (下面的那些<>
)应该像他们一样工作。

某人的想法???

问候

Michel Posseth

Hi ,,

i live in Europe in Europe the decimal seperator is , not a .
why is it so that if i press on my numeric keypad the . a . appears ??

in my opinion it should be a , ( sounds odd but ... it should be so )

my problem :

i work currently in a companny where people do data entry with the numeric
keypad we are rewriting a cobol program ,,, in cobol you could just say
decimal seperator = dot or comma and it would work as expected . how can we
simulate the same thing in .net ??

windows settings are correct ( dutch settings ) , we work with a standard
qwerty international keyboards on all computers

so what i would like is that only the numeric keypad . will give a , as
this is the numeric seperator symbol the keyboards ,. ( the ones below <>
) should work as they do.

someone an idea ???

regards

Michel Posseth


有没有办法重新映射那个特定的密钥?

T


Is there some way of remapping that particular key?

T



这篇关于arrghh dot vs逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆