C# : How to handle the ENTER key

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

    #1

    C# : How to handle the ENTER key

    i had designed a win app(an address book)

    when the user wants to enter the contact he will type in all the
    details and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"

    i want to simplify this task for the user by allowing the data to bw
    added in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
    DETAILS"

  • Alex Meleta

    #2
    Re: C# : How to handle the ENTER key


    Hi, KenDev

    Easy way is to create a default button and make a form to accept the button
    as defult action by enter.

    WBR, Alex Meleta
    Blog:: devkids.blogspo t.com



    si had designed a win app(an address book)
    s>
    swhen the user wants to enter the contact he will type in all the
    sdetails and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"
    s>
    si want to simplify this task for the user by allowing the data to bw
    sadded in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
    sDETAILS"
    s>


    Comment

    • Aneesh Pulukkul[MCSD.Net]

      #3
      Re: C# : How to handle the ENTER key

      On Jun 7, 7:44 pm, Alex Meleta <amel...@gmail. comwrote:
      Hi, KenDev
      >
      Easy way is to create a default button and make a form to accept the button
      as defult action by enter.
      >
      WBR, Alex Meleta
      Blog:: devkids.blogspo t.com
      >
      si had designed a win app(an address book)
      s>
      swhen the user wants to enter the contact he will type in all the
      sdetails and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"
      s>
      si want to simplify this task for the user by allowing the data to bw
      sadded in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
      sDETAILS"
      s>
      If you want to avoid the button, trap the key in event for the
      textbox(or any input box) that you are using. KeyDown event would do I
      think.

      Comment

      • sravan_reddy001

        #4
        Re: C# : How to handle the ENTER key

        that's good idea but how can we create a default button and make the
        form accept the buuton on pressing the enter key..
        Hi, KenDev
        >
        Easy way is to create a default button and make a form to accept the button
        as defult action by enter.
        >
        WBR, Alex Meleta
        Blog:: devkids.blogspo t.com
        >

        Comment

        • Alex Meleta

          #5
          Re: C# : How to handle the ENTER key


          You can make button default by setting the ".AcceptBut ton" property of the
          form to the instance of button.

          Alex



          that's good idea but how can we create a default button and make the
          form accept the buuton on pressing the enter key..
          >
          >Hi, KenDev
          >>
          >Easy way is to create a default button and make a form to accept the
          >button as defult action by enter.
          >>
          >WBR, Alex Meleta
          >Blog:: devkids.blogspo t.com

          Comment

          Working...