|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
arrghh dot vs commai 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 wrote:
Show quoteHide quote >Hi ,, Is there some way of remapping that particular key?> >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 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 Show quoteHide quote "tomb" <t***@technetcenter.com> wrote in message news:cBjcg.55450$iB2.9280@bignews4.bellsouth.net... > M. Posseth wrote: > >>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 >> >> >> > Is there some way of remapping that particular key? > > T i have thought about this to however then you are not able to use a . when
you might need it if i have a grid with 2 fileds for instance and i need to enter in the second filed m. posseth i would get m, posseth so it should only work on the numeric keypad`s . regards Michel Posseth Show quoteHide quote "Fred Hedges" wrote: > 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" <t***@technetcenter.com> wrote in message > news:cBjcg.55450$iB2.9280@bignews4.bellsouth.net... > > M. Posseth wrote: > > > >>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 > >> > >> > >> > > Is there some way of remapping that particular key? > > > > T > > > On hwihc control have you tried Fred suggestion. IMO it shoulmd be done on a
control by control basis (for example you may want to use , instead of . for a textbox that accept numeric values but would lioke still to use . if the textbox is for entering text). -- Patrice "M. Posseth" <MPoss***@discussions.microsoft.com> a écrit dans le message de news: 0CFD84AA-0EAD-49AF-95A8-BDA274297***@microsoft.com...Show quoteHide quote >i have thought about this to however then you are not able to use a . when > you might need it > > > if i have a grid with 2 fileds for instance and i need to enter in the > second filed m. posseth i would get m, posseth > > so it should only work on the numeric keypad`s . > > regards > > Michel Posseth > > > "Fred Hedges" wrote: > >> 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" <t***@technetcenter.com> wrote in message >> news:cBjcg.55450$iB2.9280@bignews4.bellsouth.net... >> > M. Posseth wrote: >> > >> >>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 >> >> >> >> >> >> >> > Is there some way of remapping that particular key? >> > >> > T >> >> >> Exact and that is the reasson why i only want it on the numeric keypad dot
( this is how the Calculator and Excel do this ) regards Michel Posseth Show quoteHide quote "Patrice" <scr***@chez.com> schreef in bericht news:eoxX1KbfGHA.1320@TK2MSFTNGP04.phx.gbl... > On hwihc control have you tried Fred suggestion. IMO it shoulmd be done on > a control by control basis (for example you may want to use , instead of . > for a textbox that accept numeric values but would lioke still to use . if > the textbox is for entering text). > > -- > Patrice > > "M. Posseth" <MPoss***@discussions.microsoft.com> a écrit dans le message > de news: 0CFD84AA-0EAD-49AF-95A8-BDA274297***@microsoft.com... >>i have thought about this to however then you are not able to use a . >>when >> you might need it >> >> >> if i have a grid with 2 fileds for instance and i need to enter in the >> second filed m. posseth i would get m, posseth >> >> so it should only work on the numeric keypad`s . >> >> regards >> >> Michel Posseth >> >> >> "Fred Hedges" wrote: >> >>> 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" <t***@technetcenter.com> wrote in message >>> news:cBjcg.55450$iB2.9280@bignews4.bellsouth.net... >>> > M. Posseth wrote: >>> > >>> >>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 >>> >> >>> >> >>> >> >>> > Is there some way of remapping that particular key? >>> > >>> > T >>> >>> >>> > > 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.NumberDecimalSeparator = "," 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 :-|Show quoteHide quote "tomb" wrote: > M. Posseth wrote: > > >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 > > > > > > > > > > > > > Is there some way of remapping that particular key? > > T > This is by design and should not affect your program.
You can recreate this in other windows apps like calc.exe. If it type "9.9", "9.9" appears on the window. Anway, you can customise it in the regional settings applet from control panel. no not true
when i open calc or excel the keys are mapped so i see 3,60 when i actually press 3.60 on my numeric keypad ( this is how it should work ) however in my program or in notepad when i press the numeric seperator i recive a . and i need it to be a , ( because of the regional settings ) as you see above in this thread there are workarounds that work on textbox controls etc etc however it doesn`t seem to work on the datagridview control anyone an idea regards Michel posseth regards Michel Posseth Show quoteHide quote "Hugh Janus" wrote: > This is by design and should not affect your program. > > You can recreate this in other windows apps like calc.exe. If it type > "9.9", "9.9" appears on the window. Anway, you can customise it in the > regional settings applet from control panel. > > Michael,
Yes I know the problem in Holland, I once had a job where I was in tight contact with IBM PC division.(which I assume had about 90% of the market than). I had the same problem as you and asked all the time at by instance Dutch IBM Dealer meetings for a Dutch keyboard, meaning with that is the decimal separator a comma instead of a dot and some additions to use the florin, and some French characters signs under an alt key. They were glad to present me at a certain moment the Dutch keyboard. I did not understand how people could have made such a keyboard, but they told that it was according the standard specification for a Dutch Typewriter from somewhere before the World War II. I am sorry; I myself have never used those and tried to avoid selling them. But in that terrible thing is the decimal separator a comma. (I don't advice you to use it, it is in my opinion ever worse than Azerty for us) Cor Show quoteHide quote "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht news:EA07776C-C1A5-4EF0-8403-4B6F26EB73BA@microsoft.com... > 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 > > > > Well Cor there must be a programatic solution ,,, as Microsoft uses this in
there products ( look at the calculator and Excel ) there the numeric seperator key ( . on numeric keypad ) is swapped with a , if you go to notepad the . still displays a . so i guess they are intercepring the key in the program in some way i have found some code that claimed it could do this the same way ( see up in the thread ) however this doesn`t work in a datagridview control regards Michel Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schreef in bericht news:%23783bGbfGHA.5104@TK2MSFTNGP04.phx.gbl... > Michael, > > Yes I know the problem in Holland, I once had a job where I was in tight > contact with IBM PC division.(which I assume had about 90% of the market > than). > > I had the same problem as you and asked all the time at by instance Dutch > IBM Dealer meetings for a Dutch keyboard, meaning with that is the decimal > separator a comma instead of a dot and some additions to use the florin, > and some French characters signs under an alt key. > > They were glad to present me at a certain moment the Dutch keyboard. I did > not understand how people could have made such a keyboard, but they told > that it was according the standard specification for a Dutch Typewriter > from somewhere before the World War II. > > I am sorry; I myself have never used those and tried to avoid selling > them. But in that terrible thing is the decimal separator a comma. (I > don't advice you to use it, it is in my opinion ever worse than Azerty for > us) > > Cor > > "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht > news:EA07776C-C1A5-4EF0-8403-4B6F26EB73BA@microsoft.com... >> 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" <MPoss***@discussions.microsoft.com> schrieb: On my German ('de-AT') system pressing the "," key on the numpad a "," > 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 ) appears. "," is the decimal separator in 'de-AT' and 'de-DE'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Herfried,
On the Dutch keyboard as well in Holland, but there is probably no sole that is using that. Cor Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht news:eov2s$bfGHA.3888@TK2MSFTNGP04.phx.gbl... > "M. Posseth" <MPoss***@discussions.microsoft.com> schrieb: >> 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 ) > > On my German ('de-AT') system pressing the "," key on the numpad a "," > appears. "," is the decimal separator in 'de-AT' and 'de-DE'. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> yes that is probably the hole problem that eveyone in the Netherlands is
using a international QWERTY keyboard however in my opinion it is strange that MS programs tackle this problem by remapping the keys during runtime and that there seems to be no standard method to reproduce this behavior for us . if i could remap it permanently through a registry setting this would work for me ( only for the dot on the numeric keypad should a comma appear ) so if someone knows how to do this i would be verry happy :-) regards Michel Posseth Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schreef in bericht news:uyuvN3cfGHA.3652@TK2MSFTNGP02.phx.gbl... > Herfried, > > On the Dutch keyboard as well in Holland, but there is probably no sole > that is using that. > > Cor > > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht > news:eov2s$bfGHA.3888@TK2MSFTNGP04.phx.gbl... >> "M. Posseth" <MPoss***@discussions.microsoft.com> schrieb: >>> 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 ) >> >> On my German ('de-AT') system pressing the "," key on the numpad a "," >> appears. "," is the decimal separator in 'de-AT' and 'de-DE'. >> >> -- >> M S Herfried K. Wagner >> M V P <URL:http://dotnet.mvps.org/> >> V B <URL:http://classicvb.org/petition/> > > Michel,
I thought trying to to this problem for you today, I am not sure if I have time for that because I go out in some minutes. It would be based on the fact that you can cast a textbox in a datagrid and use its events. I would use the keyup event and watch if the value is a dot and replace that than by a comma and a comma by a dot. (You have than to play with the selected position and things like that, but I assume that you know that, there are plenty of samples in this newsgroup about the numeric textbox and in fact do you have to extend that). I had the idea that I did something before. Cor Thank you Cor,
I am happy that you understand the problem :-) i have just found a workaround that unfortanitly is not exactly what i want if i add this key to the registry Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,33,00,53,00,00,00,00,00 it works great , however waht if the user changes his settings to for instance US settings ?? well the dot will then still produce a , so he needs to remove the registry key also a problem is that the user should log off and log on before the added key takes effect it would be much nicer if there is a way to simulate the behavior on program start and remove it on program end or as you mentioned if it is possible to trap the key events on certain columns in the datagridview and change the numeric dot for a comma this would be nice , overall trapping wouldn`t work as it must be possible to enter in a text column in the datagrid M. Posseth and in the column besides it 8,99 where the dot after M. is made with >. key and the 8,99 is made with the del. key ofcourse it is no problem if del. key creates in the first column a . and in the second wich holds numeric values creates a , regards Michel Posseth Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Michel, > > I thought trying to to this problem for you today, I am not sure if I have > time for that because I go out in some minutes. > > It would be based on the fact that you can cast a textbox in a datagrid and > use its events. > > I would use the keyup event and watch if the value is a dot and replace that > than by a comma and a comma by a dot. (You have than to play with the > selected position and things like that, but I assume that you know that, > there are plenty of samples in this newsgroup about the numeric textbox and > in fact do you have to extend that). > > I had the idea that I did something before. > > Cor > > > Sometimes the solution can be so simple ,,, you just have to see it
so for all you outta there with us keyboards in european country`s ( like it is the standard in the Netherlands ) take a form set it`s keypreview property to true Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyData = Keys.Decimal AndAlso System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator = "," Then e.SuppressKeyPress = True My.Computer.Keyboard.SendKeys(","c) End If End Sub now it works exactly as calc.exe and Excel thus numeric seperator on the num pad ( . ) will now give a , if this is the system setting regards and thanks to all of you for thinking with me to solve this problem regards Michel Posseth Show quoteHide quote "M. Posseth" wrote: > Thank you Cor, > > I am happy that you understand the problem :-) > > > i have just found a workaround that unfortanitly is not exactly what i want > > if i add this key to the registry > > Windows Registry Editor Version 5.00 > > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] > "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,33,00,53,00,00,00,00,00 > > it works great , however waht if the user changes his settings to for > instance US settings ?? well the dot will then still produce a , so he needs > to remove the registry key > > also a problem is that the user should log off and log on before the added > key takes effect > > it would be much nicer if there is a way to simulate the behavior on program > start and remove it on program end > > or as you mentioned if it is possible to trap the key events on certain > columns in the datagridview and change the numeric dot for a comma this > would be nice , overall trapping wouldn`t work as it must be possible to > enter in a text column in the datagrid M. Posseth and in the column besides > it 8,99 > > where the dot after M. is made with >. key and the 8,99 is made with > the del. key ofcourse it is no problem if del. key creates in the first > column a . and in the second wich holds numeric values creates a , > > regards > > Michel Posseth > > > > > > > > "Cor Ligthert [MVP]" wrote: > > > Michel, > > > > I thought trying to to this problem for you today, I am not sure if I have > > time for that because I go out in some minutes. > > > > It would be based on the fact that you can cast a textbox in a datagrid and > > use its events. > > > > I would use the keyup event and watch if the value is a dot and replace that > > than by a comma and a comma by a dot. (You have than to play with the > > selected position and things like that, but I assume that you know that, > > there are plenty of samples in this newsgroup about the numeric textbox and > > in fact do you have to extend that). > > > > I had the idea that I did something before. > > > > Cor > > > > > > Michel,
If you use the key up event it is mostly even more simple. Cor Show quoteHide quote "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@microsoft.com... > Sometimes the solution can be so simple ,,, you just have to see it > > > so for all you outta there with us keyboards in european country`s ( like > it > is the standard in the Netherlands ) > > take a form set it`s keypreview property to true > > Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As > System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown > If e.KeyData = Keys.Decimal AndAlso > System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator = > "," Then > e.SuppressKeyPress = True > My.Computer.Keyboard.SendKeys(","c) > End If > > End Sub > > now it works exactly as calc.exe and Excel thus numeric seperator on > the > num pad ( . ) will now give a , if this is the system setting > > regards > > and thanks to all of you for thinking with me to solve this problem > > regards > > Michel Posseth > > > > > "M. Posseth" wrote: > >> Thank you Cor, >> >> I am happy that you understand the problem :-) >> >> >> i have just found a workaround that unfortanitly is not exactly what i >> want >> >> if i add this key to the registry >> >> Windows Registry Editor Version 5.00 >> >> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] >> "Scancode >> Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,33,00,53,00,00,00,00,00 >> >> it works great , however waht if the user changes his settings to for >> instance US settings ?? well the dot will then still produce a , so he >> needs >> to remove the registry key >> >> also a problem is that the user should log off and log on before the >> added >> key takes effect >> >> it would be much nicer if there is a way to simulate the behavior on >> program >> start and remove it on program end >> >> or as you mentioned if it is possible to trap the key events on certain >> columns in the datagridview and change the numeric dot for a comma this >> would be nice , overall trapping wouldn`t work as it must be possible to >> enter in a text column in the datagrid M. Posseth and in the column >> besides >> it 8,99 >> >> where the dot after M. is made with >. key and the 8,99 is made >> with >> the del. key ofcourse it is no problem if del. key creates in the >> first >> column a . and in the second wich holds numeric values creates a , >> >> regards >> >> Michel Posseth >> >> >> >> >> >> >> >> "Cor Ligthert [MVP]" wrote: >> >> > Michel, >> > >> > I thought trying to to this problem for you today, I am not sure if I >> > have >> > time for that because I go out in some minutes. >> > >> > It would be based on the fact that you can cast a textbox in a datagrid >> > and >> > use its events. >> > >> > I would use the keyup event and watch if the value is a dot and replace >> > that >> > than by a comma and a comma by a dot. (You have than to play with the >> > selected position and things like that, but I assume that you know >> > that, >> > there are plenty of samples in this newsgroup about the numeric textbox >> > and >> > in fact do you have to extend that). >> > >> > I had the idea that I did something before. >> > >> > Cor >> > >> > >> > Cor
what is the advantage of using the key up event in contradiction to the key down event ??? Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Michel, > > If you use the key up event it is mostly even more simple. > > Cor > > "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht > news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@microsoft.com... > > Sometimes the solution can be so simple ,,, you just have to see it > > > > > > so for all you outta there with us keyboards in european country`s ( like > > it > > is the standard in the Netherlands ) > > > > take a form set it`s keypreview property to true > > > > Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As > > System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown > > If e.KeyData = Keys.Decimal AndAlso > > System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator = > > "," Then > > e.SuppressKeyPress = True > > My.Computer.Keyboard.SendKeys(","c) > > End If > > > > End Sub > > > > now it works exactly as calc.exe and Excel thus numeric seperator on > > the > > num pad ( . ) will now give a , if this is the system setting > > > > regards > > > > and thanks to all of you for thinking with me to solve this problem > > > > regards > > > > Michel Posseth > > > > > > > > > > "M. Posseth" wrote: > > > >> Thank you Cor, > >> > >> I am happy that you understand the problem :-) > >> > >> > >> i have just found a workaround that unfortanitly is not exactly what i > >> want > >> > >> if i add this key to the registry > >> > >> Windows Registry Editor Version 5.00 > >> > >> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] > >> "Scancode > >> Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,33,00,53,00,00,00,00,00 > >> > >> it works great , however waht if the user changes his settings to for > >> instance US settings ?? well the dot will then still produce a , so he > >> needs > >> to remove the registry key > >> > >> also a problem is that the user should log off and log on before the > >> added > >> key takes effect > >> > >> it would be much nicer if there is a way to simulate the behavior on > >> program > >> start and remove it on program end > >> > >> or as you mentioned if it is possible to trap the key events on certain > >> columns in the datagridview and change the numeric dot for a comma this > >> would be nice , overall trapping wouldn`t work as it must be possible to > >> enter in a text column in the datagrid M. Posseth and in the column > >> besides > >> it 8,99 > >> > >> where the dot after M. is made with >. key and the 8,99 is made > >> with > >> the del. key ofcourse it is no problem if del. key creates in the > >> first > >> column a . and in the second wich holds numeric values creates a , > >> > >> regards > >> > >> Michel Posseth > >> > >> > >> > >> > >> > >> > >> > >> "Cor Ligthert [MVP]" wrote: > >> > >> > Michel, > >> > > >> > I thought trying to to this problem for you today, I am not sure if I > >> > have > >> > time for that because I go out in some minutes. > >> > > >> > It would be based on the fact that you can cast a textbox in a datagrid > >> > and > >> > use its events. > >> > > >> > I would use the keyup event and watch if the value is a dot and replace > >> > that > >> > than by a comma and a comma by a dot. (You have than to play with the > >> > selected position and things like that, but I assume that you know > >> > that, > >> > there are plenty of samples in this newsgroup about the numeric textbox > >> > and > >> > in fact do you have to extend that). > >> > > >> > I had the idea that I did something before. > >> > > >> > Cor > >> > > >> > > >> > > > > Michel,
See it yourself what information you get when using the e. It is already done information. The moment itself is from no influence; if a key is pushed down it comes mostly from itself again up. I also never the e.suppress etc. Cor Show quoteHide quote "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht news:E2FA0181-951C-40AF-9A99-95B692341BB6@microsoft.com... > Cor > > what is the advantage of using the key up event in contradiction to the > key > down event ??? > > > > > "Cor Ligthert [MVP]" wrote: > >> Michel, >> >> If you use the key up event it is mostly even more simple. >> >> Cor >> >> "M. Posseth" <MPoss***@discussions.microsoft.com> schreef in bericht >> news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@microsoft.com... >> > Sometimes the solution can be so simple ,,, you just have to see it >> > >> > >> > so for all you outta there with us keyboards in european country`s ( >> > like >> > it >> > is the standard in the Netherlands ) >> > >> > take a form set it`s keypreview property to true >> > >> > Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As >> > System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown >> > If e.KeyData = Keys.Decimal AndAlso >> > System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator >> > = >> > "," Then >> > e.SuppressKeyPress = True >> > My.Computer.Keyboard.SendKeys(","c) >> > End If >> > >> > End Sub >> > >> > now it works exactly as calc.exe and Excel thus numeric seperator on >> > the >> > num pad ( . ) will now give a , if this is the system setting >> > >> > regards >> > >> > and thanks to all of you for thinking with me to solve this problem >> > >> > regards >> > >> > Michel Posseth >> > >> > >> > >> > >> > "M. Posseth" wrote: >> > >> >> Thank you Cor, >> >> >> >> I am happy that you understand the problem :-) >> >> >> >> >> >> i have just found a workaround that unfortanitly is not exactly what i >> >> want >> >> >> >> if i add this key to the registry >> >> >> >> Windows Registry Editor Version 5.00 >> >> >> >> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] >> >> "Scancode >> >> Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,33,00,53,00,00,00,00,00 >> >> >> >> it works great , however waht if the user changes his settings to for >> >> instance US settings ?? well the dot will then still produce a , so he >> >> needs >> >> to remove the registry key >> >> >> >> also a problem is that the user should log off and log on before the >> >> added >> >> key takes effect >> >> >> >> it would be much nicer if there is a way to simulate the behavior on >> >> program >> >> start and remove it on program end >> >> >> >> or as you mentioned if it is possible to trap the key events on >> >> certain >> >> columns in the datagridview and change the numeric dot for a comma >> >> this >> >> would be nice , overall trapping wouldn`t work as it must be possible >> >> to >> >> enter in a text column in the datagrid M. Posseth and in the column >> >> besides >> >> it 8,99 >> >> >> >> where the dot after M. is made with >. key and the 8,99 is made >> >> with >> >> the del. key ofcourse it is no problem if del. key creates in >> >> the >> >> first >> >> column a . and in the second wich holds numeric values creates a , >> >> >> >> regards >> >> >> >> Michel Posseth >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Cor Ligthert [MVP]" wrote: >> >> >> >> > Michel, >> >> > >> >> > I thought trying to to this problem for you today, I am not sure if >> >> > I >> >> > have >> >> > time for that because I go out in some minutes. >> >> > >> >> > It would be based on the fact that you can cast a textbox in a >> >> > datagrid >> >> > and >> >> > use its events. >> >> > >> >> > I would use the keyup event and watch if the value is a dot and >> >> > replace >> >> > that >> >> > than by a comma and a comma by a dot. (You have than to play with >> >> > the >> >> > selected position and things like that, but I assume that you know >> >> > that, >> >> > there are plenty of samples in this newsgroup about the numeric >> >> > textbox >> >> > and >> >> > in fact do you have to extend that). >> >> > >> >> > I had the idea that I did something before. >> >> > >> >> > Cor >> >> > >> >> > >> >> > >> >> >>
How to have a clean exit
But what about them hackers? Resetting the value of a System.Web.UI.HtmlControls.HtmlInputFile Really puzzled (or maybe just totally confused) about VB.NET and ADO.NET AppStartup "Cancel" leaves splash form loaded Word automation version problem. Stepping through datagridview rows in code Caret Hiding Setting tab stops in RTF control Custom Datagridstyle |
|||||||||||||||||||||||