PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Where is the "default" property of the Command Button Object in VB.net

Reply

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

 
Thread Tools Rate Thread
Old 24-08-2006, 02:30 AM   #1
simonoficina@gmail.com
Guest
 
Posts: n/a
Default 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

  Reply With Quote
Old 24-08-2006, 04:25 AM   #2
gene kelley
Guest
 
Posts: n/a
Default Re: Where is the "default" property of the Command Button Object in VB.net

On 23 Aug 2006 18:30:48 -0700, simonoficina@gmail.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 "AcceptButton" and "CancelButton". If a button exists on a form it
can be assigned as the "AcceptButton", and, likewise for a "CancelButton".

Gene

  Reply With Quote
Old 24-08-2006, 04:35 AM   #3
Tom Shelton
Guest
 
Posts: n/a
Default Re: Where is the "default" property of the Command Button Object in VB.net


simonoficina@gmail.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

  Reply With Quote
Old 24-08-2006, 04:58 AM   #4
Greg
Guest
 
Posts: n/a
Default Re: Where is the "default" property of the Command Button Object in VB.net

"Tom Shelton" <tom@mtogden.com> wrote in message
news:1156390551.198709.120840@m79g2000cwm.googlegroups.com...
>
> simonoficina@gmail.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


  Reply With Quote
Old 24-08-2006, 05:00 AM   #5
Tom Shelton
Guest
 
Posts: n/a
Default Re: Where is the "default" property of the Command Button Object in VB.net


Tom Shelton wrote:
> simonoficina@gmail.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

  Reply With Quote
Old 24-08-2006, 07:11 AM   #6
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Where is the "default" 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@gmail.com> schreef in bericht
news:1156383048.699466.66820@74g2000cwt.googlegroups.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
>



  Reply With Quote
Old 24-08-2006, 07:24 AM   #7
Greg
Guest
 
Posts: n/a
Default Re: Where is the "default" 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.nl> wrote in message
news:uHPBxP0xGHA.1256@TK2MSFTNGP04.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.com> schreef in bericht
> news:1156383048.699466.66820@74g2000cwt.googlegroups.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
>>

>
>



  Reply With Quote
Old 24-08-2006, 10:58 AM   #8
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Where is the "default" 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.ok> schreef 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.nl> wrote in message
> news:uHPBxP0xGHA.1256@TK2MSFTNGP04.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.com> schreef in bericht
>> news:1156383048.699466.66820@74g2000cwt.googlegroups.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
>>>

>>
>>

>
>



  Reply With Quote
Old 24-08-2006, 11:22 AM   #9
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Where is the "default" property of the Command Button Object in VB.net

"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> schrieb:
> 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/>

  Reply With Quote
Old 24-08-2006, 12:03 PM   #10
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Where is the "default" 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


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off