Setting a default button?

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

    #1

    Setting a default button?

    Is there a way to set a button that will execute if the user hits
    <enter>?

    Thanks,
    Brett

  • dotnetchic

    #2
    Re: Setting a default button?

    Brett,

    see Form.AcceptButt on
    there's also a Form.CancelButt on

    -SLC

    Comment

    • Tim Wilson

      #3
      Re: Setting a default button?

      The Form has an AcceptButton property that you can assign the default
      Button.

      --
      Tim Wilson
      ..NET Compact Framework MVP

      "Brett Romero" <account@cygen. com> wrote in message
      news:1140718529 .742195.118890@ p10g2000cwp.goo glegroups.com.. .[color=blue]
      > Is there a way to set a button that will execute if the user hits
      > <enter>?
      >
      > Thanks,
      > Brett
      >[/color]


      Comment

      • pagates

        #4
        RE: Setting a default button?

        Assuming that you are talking about a Windows Form, then set the AcceptButton
        property on the form (not on the button).

        Setting the CancelButton property will set a button that executes when
        pressing the Esc key.

        HTH,
        pagates

        "Brett Romero" wrote:
        [color=blue]
        > Is there a way to set a button that will execute if the user hits
        > <enter>?
        >
        > Thanks,
        > Brett
        >
        >[/color]

        Comment

        Working...