Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. enter

enter

Scheduled Pinned Locked Moved C#
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    heba_zien
    wrote on last edited by
    #1

    hi i make a win app , iwant to make the action of enter press in keyboard as the action of button OK in my form i dont Know how;)

    B 1 Reply Last reply
    0
    • H heba_zien

      hi i make a win app , iwant to make the action of enter press in keyboard as the action of button OK in my form i dont Know how;)

      B Offline
      B Offline
      Bill Dean
      wrote on last edited by
      #2

      Hi, The Form has an "AcceptButton" property that will do let you this. Viewing the form in Design mode, look at the properties window. The AcceptButton property will have a list of all the buttons on the form. Pick you one you want. Or you can set it in code: Button MyButton=new Button(); ... Form.AcceptButton=MyButton According to the Help: "You can use this property to allow the user to quickly navigate a simple form by allowing them to simply press the ENTER key when they are finished instead of manually clicking the accept button with their mouse." In a nutshell, when the user hits enter, the Click event on the specified button is fired. Hope this helps, Bill ps: there is a CancelButton property that sets a default button for ESC.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups