arrghh dot vs comma

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M. Posseth

    #16
    Re: arrghh dot vs comma

    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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\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:
    [color=blue]
    > 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
    >
    >
    >[/color]

    Comment

    • M. Posseth

      #17
      Re: arrghh dot vs comma

      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(B yVal sender As Object, ByVal e As
      System.Windows. Forms.KeyEventA rgs) Handles Me.KeyDown
      If e.KeyData = Keys.Decimal AndAlso
      System.Globaliz ation.NumberFor matInfo.Current Info.NumberDeci malSeparator =
      "," Then
      e.SuppressKeyPr ess = True
      My.Computer.Key board.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:
      [color=blue]
      > 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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\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:
      >[color=green]
      > > 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
      > >
      > >
      > >[/color][/color]

      Comment

      • Cor Ligthert [MVP]

        #18
        Re: arrghh dot vs comma

        Michel,

        If you use the key up event it is mostly even more simple.

        Cor

        "M. Posseth" <MPosseth@discu ssions.microsof t.com> schreef in bericht
        news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@mi crosoft.com...[color=blue]
        > 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(B yVal sender As Object, ByVal e As
        > System.Windows. Forms.KeyEventA rgs) Handles Me.KeyDown
        > If e.KeyData = Keys.Decimal AndAlso
        > System.Globaliz ation.NumberFor matInfo.Current Info.NumberDeci malSeparator =
        > "," Then
        > e.SuppressKeyPr ess = True
        > My.Computer.Key board.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:
        >[color=green]
        >> 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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\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:
        >>[color=darkred]
        >> > 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
        >> >
        >> >
        >> >[/color][/color][/color]


        Comment

        • M. Posseth

          #19
          Re: arrghh dot vs comma

          Cor

          what is the advantage of using the key up event in contradiction to the key
          down event ???




          "Cor Ligthert [MVP]" wrote:
          [color=blue]
          > Michel,
          >
          > If you use the key up event it is mostly even more simple.
          >
          > Cor
          >
          > "M. Posseth" <MPosseth@discu ssions.microsof t.com> schreef in bericht
          > news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@mi crosoft.com...[color=green]
          > > 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(B yVal sender As Object, ByVal e As
          > > System.Windows. Forms.KeyEventA rgs) Handles Me.KeyDown
          > > If e.KeyData = Keys.Decimal AndAlso
          > > System.Globaliz ation.NumberFor matInfo.Current Info.NumberDeci malSeparator =
          > > "," Then
          > > e.SuppressKeyPr ess = True
          > > My.Computer.Key board.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:
          > >[color=darkred]
          > >> 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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\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
          > >> >
          > >> >
          > >> >[/color][/color]
          >
          >
          >[/color]

          Comment

          • Cor Ligthert [MVP]

            #20
            Re: arrghh dot vs comma

            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

            "M. Posseth" <MPosseth@discu ssions.microsof t.com> schreef in bericht
            news:E2FA0181-951C-40AF-9A99-95B692341BB6@mi crosoft.com...[color=blue]
            > Cor
            >
            > what is the advantage of using the key up event in contradiction to the
            > key
            > down event ???
            >
            >
            >
            >
            > "Cor Ligthert [MVP]" wrote:
            >[color=green]
            >> Michel,
            >>
            >> If you use the key up event it is mostly even more simple.
            >>
            >> Cor
            >>
            >> "M. Posseth" <MPosseth@discu ssions.microsof t.com> schreef in bericht
            >> news:B39BACA7-1BDA-4FAC-B0E9-9F508FF2FBFC@mi crosoft.com...[color=darkred]
            >> > 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(B yVal sender As Object, ByVal e As
            >> > System.Windows. Forms.KeyEventA rgs) Handles Me.KeyDown
            >> > If e.KeyData = Keys.Decimal AndAlso
            >> > System.Globaliz ation.NumberFor matInfo.Current Info.NumberDeci malSeparator
            >> > =
            >> > "," Then
            >> > e.SuppressKeyPr ess = True
            >> > My.Computer.Key board.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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\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
            >> >> >
            >> >> >
            >> >> >[/color]
            >>
            >>
            >>[/color][/color]


            Comment

            Working...