return key

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

    #1

    return key

    Is there a way that I can control exactly what happens when the user presses
    the return key in a TextBox?


  • Michael Daniels

    #2
    Re: return key

    inherite a class from text box and override the:

    protected override bool HandleKeyPress( char ch){

    }

    Regards

    Michael

    "Gav" <spam@spam.co m> schrieb im Newsbeitrag
    news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Is there a way that I can control exactly what happens when the user[/color]
    presses[color=blue]
    > the return key in a TextBox?
    >
    >[/color]


    Comment

    • Sunny

      #3
      Re: return key

      Why you have to create a new class for every textbox? Just one, and after
      that you can use it for every such a textbox, which Enter key you want to
      control.

      Sunny
      "Gav" <spam@spam.co m> wrote in message
      news:OXyfE7BXDH A.1644@TK2MSFTN GP10.phx.gbl...[color=blue]
      > Thanks... it seems a bit long winded to have to create a new class for[/color]
      every[color=blue]
      > TextBox. I have heard of a onenter method of a text box such as
      >
      > <asp:textbox onfocus='...... . onenter=''>
      >
      > Is this actually available or just pipe dreams
      >
      > "Michael Daniels" <spammichzu@spa mmer.de> wrote in message
      > news:e%23kt%23u BXDHA.2352@TK2M SFTNGP12.phx.gb l...[color=green]
      > > inherite a class from text box and override the:
      > >
      > > protected override bool HandleKeyPress( char ch){
      > >
      > > }
      > >
      > > Regards
      > >
      > > Michael
      > >
      > > "Gav" <spam@spam.co m> schrieb im Newsbeitrag
      > > news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...[color=darkred]
      > > > Is there a way that I can control exactly what happens when the user[/color]
      > > presses[color=darkred]
      > > > the return key in a TextBox?
      > > >
      > > >[/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Gav

        #4
        Re: return key

        But I want it to do something different depending on which Textbox they
        press <enter> in... unless there is a way to pass the controls name with it
        also or something like that.

        "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
        news:ebTY4PCXDH A.2648@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Why you have to create a new class for every textbox? Just one, and after
        > that you can use it for every such a textbox, which Enter key you want to
        > control.
        >
        > Sunny
        > "Gav" <spam@spam.co m> wrote in message
        > news:OXyfE7BXDH A.1644@TK2MSFTN GP10.phx.gbl...[color=green]
        > > Thanks... it seems a bit long winded to have to create a new class for[/color]
        > every[color=green]
        > > TextBox. I have heard of a onenter method of a text box such as
        > >
        > > <asp:textbox onfocus='...... . onenter=''>
        > >
        > > Is this actually available or just pipe dreams
        > >
        > > "Michael Daniels" <spammichzu@spa mmer.de> wrote in message
        > > news:e%23kt%23u BXDHA.2352@TK2M SFTNGP12.phx.gb l...[color=darkred]
        > > > inherite a class from text box and override the:
        > > >
        > > > protected override bool HandleKeyPress( char ch){
        > > >
        > > > }
        > > >
        > > > Regards
        > > >
        > > > Michael
        > > >
        > > > "Gav" <spam@spam.co m> schrieb im Newsbeitrag
        > > > news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...
        > > > > Is there a way that I can control exactly what happens when the user
        > > > presses
        > > > > the return key in a TextBox?
        > > > >
        > > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • niv

          #5
          Re: return key

          pass the object, accept a sender parameter. Then cast the
          object into a textbox and get its name.

          hth
          niv[color=blue]
          >-----Original Message-----
          >But I want it to do something different depending on[/color]
          which Textbox they[color=blue]
          >press <enter> in... unless there is a way to pass the[/color]
          controls name with it[color=blue]
          >also or something like that.
          >
          >"Sunny" <sunnyask@icebe rgwireless.com> wrote in message
          >news:ebTY4PCXD HA.2648@TK2MSFT NGP09.phx.gbl.. .[color=green]
          >> Why you have to create a new class for every textbox?[/color][/color]
          Just one, and after[color=blue][color=green]
          >> that you can use it for every such a textbox, which[/color][/color]
          Enter key you want to[color=blue][color=green]
          >> control.
          >>
          >> Sunny
          >> "Gav" <spam@spam.co m> wrote in message
          >> news:OXyfE7BXDH A.1644@TK2MSFTN GP10.phx.gbl...[color=darkred]
          >> > Thanks... it seems a bit long winded to have to[/color][/color][/color]
          create a new class for[color=blue][color=green]
          >> every[color=darkred]
          >> > TextBox. I have heard of a onenter method of a text[/color][/color][/color]
          box such as[color=blue][color=green][color=darkred]
          >> >
          >> > <asp:textbox onfocus='...... . onenter=''>
          >> >
          >> > Is this actually available or just pipe dreams
          >> >
          >> > "Michael Daniels" <spammichzu@spa mmer.de> wrote in[/color][/color][/color]
          message[color=blue][color=green][color=darkred]
          >> > news:e%23kt%23u BXDHA.2352@TK2M SFTNGP12.phx.gb l...
          >> > > inherite a class from text box and override the:
          >> > >
          >> > > protected override bool HandleKeyPress( char ch){
          >> > >
          >> > > }
          >> > >
          >> > > Regards
          >> > >
          >> > > Michael
          >> > >
          >> > > "Gav" <spam@spam.co m> schrieb im Newsbeitrag
          >> > > news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...
          >> > > > Is there a way that I can control exactly what[/color][/color][/color]
          happens when the user[color=blue][color=green][color=darkred]
          >> > > presses
          >> > > > the return key in a TextBox?
          >> > > >
          >> > > >
          >> > >
          >> > >
          >> >
          >> >[/color]
          >>
          >>[/color]
          >
          >
          >.
          >[/color]

          Comment

          • Sunny

            #6
            Re: return key

            Or, you may create a delegate for the method which will be invoked to do the
            actions. and after that what you have to do is only to change where the
            delegate points for every textbox you wish to handle.

            Sunny
            "niv" <niv@hotmail.co m> wrote in message
            news:004501c35c 38$381cee90$a40 1280a@phx.gbl.. .[color=blue]
            > pass the object, accept a sender parameter. Then cast the
            > object into a textbox and get its name.
            >
            > hth
            > niv[color=green]
            > >-----Original Message-----
            > >But I want it to do something different depending on[/color]
            > which Textbox they[color=green]
            > >press <enter> in... unless there is a way to pass the[/color]
            > controls name with it[color=green]
            > >also or something like that.
            > >
            > >"Sunny" <sunnyask@icebe rgwireless.com> wrote in message
            > >news:ebTY4PCXD HA.2648@TK2MSFT NGP09.phx.gbl.. .[color=darkred]
            > >> Why you have to create a new class for every textbox?[/color][/color]
            > Just one, and after[color=green][color=darkred]
            > >> that you can use it for every such a textbox, which[/color][/color]
            > Enter key you want to[color=green][color=darkred]
            > >> control.
            > >>
            > >> Sunny
            > >> "Gav" <spam@spam.co m> wrote in message
            > >> news:OXyfE7BXDH A.1644@TK2MSFTN GP10.phx.gbl...
            > >> > Thanks... it seems a bit long winded to have to[/color][/color]
            > create a new class for[color=green][color=darkred]
            > >> every
            > >> > TextBox. I have heard of a onenter method of a text[/color][/color]
            > box such as[color=green][color=darkred]
            > >> >
            > >> > <asp:textbox onfocus='...... . onenter=''>
            > >> >
            > >> > Is this actually available or just pipe dreams
            > >> >
            > >> > "Michael Daniels" <spammichzu@spa mmer.de> wrote in[/color][/color]
            > message[color=green][color=darkred]
            > >> > news:e%23kt%23u BXDHA.2352@TK2M SFTNGP12.phx.gb l...
            > >> > > inherite a class from text box and override the:
            > >> > >
            > >> > > protected override bool HandleKeyPress( char ch){
            > >> > >
            > >> > > }
            > >> > >
            > >> > > Regards
            > >> > >
            > >> > > Michael
            > >> > >
            > >> > > "Gav" <spam@spam.co m> schrieb im Newsbeitrag
            > >> > > news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...
            > >> > > > Is there a way that I can control exactly what[/color][/color]
            > happens when the user[color=green][color=darkred]
            > >> > > presses
            > >> > > > the return key in a TextBox?
            > >> > > >
            > >> > > >
            > >> > >
            > >> > >
            > >> >
            > >> >
            > >>
            > >>[/color]
            > >
            > >
            > >.
            > >[/color][/color]


            Comment

            • Gav

              #7
              Re: return key

              Thanks for the help all

              "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
              news:ePZBgmDXDH A.2392@TK2MSFTN GP10.phx.gbl...[color=blue]
              > Or, you may create a delegate for the method which will be invoked to do[/color]
              the[color=blue]
              > actions. and after that what you have to do is only to change where the
              > delegate points for every textbox you wish to handle.
              >
              > Sunny
              > "niv" <niv@hotmail.co m> wrote in message
              > news:004501c35c 38$381cee90$a40 1280a@phx.gbl.. .[color=green]
              > > pass the object, accept a sender parameter. Then cast the
              > > object into a textbox and get its name.
              > >
              > > hth
              > > niv[color=darkred]
              > > >-----Original Message-----
              > > >But I want it to do something different depending on[/color]
              > > which Textbox they[color=darkred]
              > > >press <enter> in... unless there is a way to pass the[/color]
              > > controls name with it[color=darkred]
              > > >also or something like that.
              > > >
              > > >"Sunny" <sunnyask@icebe rgwireless.com> wrote in message
              > > >news:ebTY4PCXD HA.2648@TK2MSFT NGP09.phx.gbl.. .
              > > >> Why you have to create a new class for every textbox?[/color]
              > > Just one, and after[color=darkred]
              > > >> that you can use it for every such a textbox, which[/color]
              > > Enter key you want to[color=darkred]
              > > >> control.
              > > >>
              > > >> Sunny
              > > >> "Gav" <spam@spam.co m> wrote in message
              > > >> news:OXyfE7BXDH A.1644@TK2MSFTN GP10.phx.gbl...
              > > >> > Thanks... it seems a bit long winded to have to[/color]
              > > create a new class for[color=darkred]
              > > >> every
              > > >> > TextBox. I have heard of a onenter method of a text[/color]
              > > box such as[color=darkred]
              > > >> >
              > > >> > <asp:textbox onfocus='...... . onenter=''>
              > > >> >
              > > >> > Is this actually available or just pipe dreams
              > > >> >
              > > >> > "Michael Daniels" <spammichzu@spa mmer.de> wrote in[/color]
              > > message[color=darkred]
              > > >> > news:e%23kt%23u BXDHA.2352@TK2M SFTNGP12.phx.gb l...
              > > >> > > inherite a class from text box and override the:
              > > >> > >
              > > >> > > protected override bool HandleKeyPress( char ch){
              > > >> > >
              > > >> > > }
              > > >> > >
              > > >> > > Regards
              > > >> > >
              > > >> > > Michael
              > > >> > >
              > > >> > > "Gav" <spam@spam.co m> schrieb im Newsbeitrag
              > > >> > > news:OxVUlhBXDH A.2284@TK2MSFTN GP10.phx.gbl...
              > > >> > > > Is there a way that I can control exactly what[/color]
              > > happens when the user[color=darkred]
              > > >> > > presses
              > > >> > > > the return key in a TextBox?
              > > >> > > >
              > > >> > > >
              > > >> > >
              > > >> > >
              > > >> >
              > > >> >
              > > >>
              > > >>
              > > >
              > > >
              > > >.
              > > >[/color][/color]
              >
              >[/color]


              Comment

              Working...