Where is the "default" property of the Command Button Object in VB.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • simonoficina@gmail.com

    Where is the "default" property of the Command Button Object in VB.net

    Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
    object has a property called "default" that can set this button like
    press "ENTER" key. But in the VB.net I can't find this property. Where
    is it? Or mabye change the other thing,No?Thanks ! Simon

  • gene kelley

    #2
    Re: Where is the "default&q uot; property of the Command Button Object in VB.net

    On 23 Aug 2006 18:30:48 -0700, simonoficina@gm ail.com wrote:
    >Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
    >object has a property called "default" that can set this button like
    >press "ENTER" key. But in the VB.net I can't find this property. Where
    >is it? Or mabye change the other thing,No?Thanks ! Simon
    (VB2005)

    That behavior is now limited to one or two buttons on any given form.

    Look at the form's properties "AcceptButt on" and "CancelButt on". If a button exists on a form it
    can be assigned as the "AcceptButt on", and, likewise for a "CancelButt on".

    Gene

    Comment

    • Tom Shelton

      #3
      Re: Where is the "default&q uot; property of the Command Button Object in VB.net


      simonoficina@gm ail.com wrote:
      Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
      object has a property called "default" that can set this button like
      press "ENTER" key. But in the VB.net I can't find this property. Where
      is it? Or mabye change the other thing,No?Thanks ! Simon
      For the most part, the concept of a "default" property has gone away.
      In VB.NET, only an indexed property can be marked as default using an
      attribute. Which, IMHO, is a very good thing. I always was one of
      those wackos that thought the use of default properties were evil....


      You can mark declare a default property using the default keyword.

      --
      Tom Shelton

      Comment

      • Tom Shelton

        #4
        Re: Where is the "default&q uot; property of the Command Button Object in VB.net


        Tom Shelton wrote:
        simonoficina@gm ail.com wrote:
        Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
        object has a property called "default" that can set this button like
        press "ENTER" key. But in the VB.net I can't find this property. Where
        is it? Or mabye change the other thing,No?Thanks ! Simon
        >
        For the most part, the concept of a "default" property has gone away.
        In VB.NET, only an indexed property can be marked as default using an
        attribute. Which, IMHO, is a very good thing. I always was one of
        those wackos that thought the use of default properties were evil....
        >
        >
        You can mark declare a default property using the default keyword.
        >
        --
        Tom Shelton
        Boy did I misread the your post... Sorry :)

        --
        Tom Shelton

        Comment

        • Greg

          #5
          Re: Where is the "default&q uot; property of the Command Button Object in VB.net

          "Tom Shelton" <tom@mtogden.co mwrote in message
          news:1156390551 .198709.120840@ m79g2000cwm.goo glegroups.com.. .
          >
          simonoficina@gm ail.com wrote:
          >Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
          >object has a property called "default" that can set this button like
          >press "ENTER" key. But in the VB.net I can't find this property. Where
          >is it? Or mabye change the other thing,No?Thanks ! Simon
          >
          For the most part, the concept of a "default" property has gone away.
          In VB.NET, only an indexed property can be marked as default using an
          attribute. Which, IMHO, is a very good thing. I always was one of
          those wackos that thought the use of default properties were evil....
          >
          >
          You can mark declare a default property using the default keyword.
          >
          --
          Tom Shelton
          Actually, the functionality is still there in VB.NET, but it has been moved
          to the form itself.
          Now every form "has a" default button property, whereby a button object can
          be assigned to this property of the form.
          In the form's properties go to the AcceptButton and CancelButton and choose
          the required button from the dropdown lists.

          Cheers,
          Greg


          Comment

          • Cor Ligthert [MVP]

            #6
            Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

            We are in the 21st century, 25 years after the first PC and people still
            want a Keyboard enter instead of a pointing device click or whatever.

            Amazing.

            Are there still people out there using only a 16" floppy disk?

            This is what I had to think about reading the OP's question.
            And surely not out of the topic.

            Cor

            <simonoficina@g mail.comschreef in bericht
            news:1156383048 .699466.66820@7 4g2000cwt.googl egroups.com...
            Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
            object has a property called "default" that can set this button like
            press "ENTER" key. But in the VB.net I can't find this property. Where
            is it? Or mabye change the other thing,No?Thanks ! Simon
            >

            Comment

            • Greg

              #7
              Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

              Sometimes your application may require typing some text into a field. A
              simple press of the Enter key would then run the application rather than
              taking your hand off the keyboard and putting it on the mouse and then
              clicking a button. The keyboard Enter and the Mouse pointing device will run
              the same default button code so you can choose EITHER not 'one INSTEAD of
              the other'.

              Cheers.

              "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
              news:uHPBxP0xGH A.1256@TK2MSFTN GP04.phx.gbl...
              We are in the 21st century, 25 years after the first PC and people still
              want a Keyboard enter instead of a pointing device click or whatever.
              >
              Amazing.
              >
              Are there still people out there using only a 16" floppy disk?
              >
              This is what I had to think about reading the OP's question.
              And surely not out of the topic.
              >
              Cor
              >
              <simonoficina@g mail.comschreef in bericht
              news:1156383048 .699466.66820@7 4g2000cwt.googl egroups.com...
              >Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
              >object has a property called "default" that can set this button like
              >press "ENTER" key. But in the VB.net I can't find this property. Where
              >is it? Or mabye change the other thing,No?Thanks ! Simon
              >>
              >
              >

              Comment

              • Cor Ligthert [MVP]

                #8
                Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                Greg,

                I thought that it was the default behaviour of a webbrowser, you don't mind
                that I say that I don't like it

                I am in the middle of a text, want to go to a new line or tab or whatever
                but my text is send.

                :-)

                Cor

                "Greg" <Greg@no-reply.okschreef in bericht
                news:ecjgmm$d43 $1@mws-stat-syd.cdn.telstra .com.au...
                Sometimes your application may require typing some text into a field. A
                simple press of the Enter key would then run the application rather than
                taking your hand off the keyboard and putting it on the mouse and then
                clicking a button. The keyboard Enter and the Mouse pointing device will
                run the same default button code so you can choose EITHER not 'one INSTEAD
                of the other'.
                >
                Cheers.
                >
                "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
                news:uHPBxP0xGH A.1256@TK2MSFTN GP04.phx.gbl...
                >We are in the 21st century, 25 years after the first PC and people still
                >want a Keyboard enter instead of a pointing device click or whatever.
                >>
                >Amazing.
                >>
                >Are there still people out there using only a 16" floppy disk?
                >>
                >This is what I had to think about reading the OP's question.
                >And surely not out of the topic.
                >>
                >Cor
                >>
                ><simonoficina@ gmail.comschree f in bericht
                >news:115638304 8.699466.66820@ 74g2000cwt.goog legroups.com...
                >>Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
                >>object has a property called "default" that can set this button like
                >>press "ENTER" key. But in the VB.net I can't find this property. Where
                >>is it? Or mabye change the other thing,No?Thanks ! Simon
                >>>
                >>
                >>
                >
                >

                Comment

                • Herfried K. Wagner [MVP]

                  #9
                  Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                  "Cor Ligthert [MVP]" <notmyfirstname @planet.nlschri eb:
                  We are in the 21st century, 25 years after the first PC and people still
                  want a Keyboard enter instead of a pointing device click or whatever.
                  >
                  Amazing.
                  Huh?! I believe I am not the only one who is using the keyboard extensively
                  to enter data and click buttons...

                  --
                  M S Herfried K. Wagner
                  M V P <URL:http://dotnet.mvps.org/>
                  V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

                  Comment

                  • Cor Ligthert [MVP]

                    #10
                    Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                    >
                    Huh?! I believe I am not the only one who is using the keyboard
                    extensively to enter data and click buttons...
                    >
                    --
                    What is it, to enter data or to automaticly click *one* buttons

                    :-)

                    Cor


                    Comment

                    • Tom Shelton

                      #11
                      Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net


                      Greg wrote:
                      "Tom Shelton" <tom@mtogden.co mwrote in message
                      news:1156390551 .198709.120840@ m79g2000cwm.goo glegroups.com.. .

                      simonoficina@gm ail.com wrote:
                      Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
                      object has a property called "default" that can set this button like
                      press "ENTER" key. But in the VB.net I can't find this property. Where
                      is it? Or mabye change the other thing,No?Thanks ! Simon
                      For the most part, the concept of a "default" property has gone away.
                      In VB.NET, only an indexed property can be marked as default using an
                      attribute. Which, IMHO, is a very good thing. I always was one of
                      those wackos that thought the use of default properties were evil....


                      You can mark declare a default property using the default keyword.

                      --
                      Tom Shelton
                      >
                      Actually, the functionality is still there in VB.NET, but it has been moved
                      to the form itself.
                      Now every form "has a" default button property, whereby a button object can
                      be assigned to this property of the form.
                      In the form's properties go to the AcceptButton and CancelButton and choose
                      the required button from the dropdown lists.
                      >
                      Cheers,
                      Greg
                      Greg,

                      I realize that, I thought the OP was talking about default properties
                      like they existed in VB6 - you know:

                      Text1 = "Hello, World"

                      Where you didn't have to specify that it was really Text1.Text. It was
                      a simple misreading of the OP's post.

                      --
                      Tom Shelton

                      Comment

                      • Jim Wooley

                        #12
                        Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                        >Huh?! I believe I am not the only one who is using the keyboard
                        >extensively to enter data and click buttons...
                        >>
                        What is it, to enter data or to automaticly click *one* buttons
                        >
                        Cor
                        >
                        It makes about as much sense as "clicking" a button by pressing the space
                        bar (when the button is highlighted).

                        Personally, I got started with heavy data input using the 10 key entry. If
                        it is an accounting system, or something that heavily uses numbers, it is
                        a pain to need to keep the left hand available for the tab key when it could
                        easily be flowing down a printed page keeping track of which line to enter.
                        (Ah the days of entering pages of hex codes from Compute! magazines...) Touch
                        typists can fly through a form much faster using the enter key to move between
                        fields than having to reach for the mouse all the time.
                        Jim Wooley



                        Comment

                        • blugrasmaniac

                          #13
                          Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                          The Default and Cancel properties have been removed from the Command
                          Button object, and have been implemented at the Form level. There is
                          an AcceptButton and CancelButton property on the Form object that
                          serves as the replacement.


                          Jim Wooley wrote:
                          Huh?! I believe I am not the only one who is using the keyboard
                          extensively to enter data and click buttons...
                          >
                          What is it, to enter data or to automaticly click *one* buttons

                          Cor
                          >
                          It makes about as much sense as "clicking" a button by pressing the space
                          bar (when the button is highlighted).
                          >
                          Personally, I got started with heavy data input using the 10 key entry. If
                          it is an accounting system, or something that heavily uses numbers, it is
                          a pain to need to keep the left hand available for the tab key when it could
                          easily be flowing down a printed page keeping track of which line to enter.
                          (Ah the days of entering pages of hex codes from Compute! magazines...) Touch
                          typists can fly through a form much faster using the enter key to move between
                          fields than having to reach for the mouse all the time.
                          Jim Wooley
                          http://devauthority.com/blogs/jwooley/default.aspx

                          Comment

                          • Greg

                            #14
                            Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net

                            "Tom Shelton" <tom@mtogden.co mwrote in message
                            news:1156425347 .198968.81540@i 3g2000cwc.googl egroups.com...
                            >
                            Greg wrote:
                            >"Tom Shelton" <tom@mtogden.co mwrote in message
                            >news:115639055 1.198709.120840 @m79g2000cwm.go oglegroups.com. ..
                            >
                            simonoficina@gm ail.com wrote:
                            >Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
                            >object has a property called "default" that can set this button like
                            >press "ENTER" key. But in the VB.net I can't find this property. Where
                            >is it? Or mabye change the other thing,No?Thanks ! Simon
                            >
                            For the most part, the concept of a "default" property has gone away.
                            In VB.NET, only an indexed property can be marked as default using an
                            attribute. Which, IMHO, is a very good thing. I always was one of
                            those wackos that thought the use of default properties were evil....
                            >
                            >
                            You can mark declare a default property using the default keyword.
                            >
                            --
                            Tom Shelton
                            >>
                            >Actually, the functionality is still there in VB.NET, but it has been
                            >moved
                            >to the form itself.
                            >Now every form "has a" default button property, whereby a button object
                            >can
                            >be assigned to this property of the form.
                            >In the form's properties go to the AcceptButton and CancelButton and
                            >choose
                            >the required button from the dropdown lists.
                            >>
                            >Cheers,
                            >Greg
                            >
                            Greg,
                            >
                            I realize that, I thought the OP was talking about default properties
                            like they existed in VB6 - you know:
                            >
                            Text1 = "Hello, World"
                            >
                            Where you didn't have to specify that it was really Text1.Text. It was
                            a simple misreading of the OP's post.
                            >
                            --
                            Tom Shelton
                            G'day Tom,

                            As the OP was talking about VB6, buttons and Enter as a default, I assumed
                            he meant how you could make the button default to an enter or esc press
                            which is now handled in VB.NET at the form level. LOL. Now I'm not even sure
                            what the OP was talking about :)

                            Cheers mate,
                            Greg.


                            Comment

                            • Tom Shelton

                              #15
                              Re: Where is the &quot;default&q uot; property of the Command Button Object in VB.net


                              Greg wrote:
                              "Tom Shelton" <tom@mtogden.co mwrote in message
                              news:1156425347 .198968.81540@i 3g2000cwc.googl egroups.com...

                              Greg wrote:
                              "Tom Shelton" <tom@mtogden.co mwrote in message
                              news:1156390551 .198709.120840@ m79g2000cwm.goo glegroups.com.. .

                              simonoficina@gm ail.com wrote:
                              Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button
                              object has a property called "default" that can set this button like
                              press "ENTER" key. But in the VB.net I can't find this property. Where
                              is it? Or mabye change the other thing,No?Thanks ! Simon

                              For the most part, the concept of a "default" property has gone away.
                              In VB.NET, only an indexed property can be marked as default using an
                              attribute. Which, IMHO, is a very good thing. I always was one of
                              those wackos that thought the use of default properties were evil....


                              You can mark declare a default property using the default keyword.

                              --
                              Tom Shelton
                              >
                              Actually, the functionality is still there in VB.NET, but it has been
                              moved
                              to the form itself.
                              Now every form "has a" default button property, whereby a button object
                              can
                              be assigned to this property of the form.
                              In the form's properties go to the AcceptButton and CancelButton and
                              choose
                              the required button from the dropdown lists.
                              >
                              Cheers,
                              Greg
                              Greg,

                              I realize that, I thought the OP was talking about default properties
                              like they existed in VB6 - you know:

                              Text1 = "Hello, World"

                              Where you didn't have to specify that it was really Text1.Text. It was
                              a simple misreading of the OP's post.

                              --
                              Tom Shelton
                              >
                              G'day Tom,
                              >
                              As the OP was talking about VB6, buttons and Enter as a default, I assumed
                              he meant how you could make the button default to an enter or esc press
                              which is now handled in VB.NET at the form level. LOL. Now I'm not even sure
                              what the OP was talking about :)
                              >
                              Cheers mate,
                              Greg.
                              I think were right about it :)

                              --
                              Tom Shelton

                              Comment

                              Working...