By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Aug 24 '06 #1
Share this Question
Share on Google+
15 Replies


P: n/a
On 23 Aug 2006 18:30:48 -0700, si**********@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

Aug 24 '06 #2

P: n/a

si**********@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

Aug 24 '06 #3

P: n/a

Tom Shelton wrote:
si**********@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

Aug 24 '06 #4

P: n/a
"Tom Shelton" <to*@mtogden.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
>
si**********@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
Aug 24 '06 #5

P: n/a
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

<si**********@gmail.comschreef in bericht
news:11*********************@74g2000cwt.googlegrou ps.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

Aug 24 '06 #6

P: n/a
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]" <no************@planet.nlwrote in message
news:uH**************@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

<si**********@gmail.comschreef in bericht
news:11*********************@74g2000cwt.googlegrou ps.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


Aug 24 '06 #7

P: n/a
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" <Gr**@no-reply.okschreef in bericht
news:ec**********@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]" <no************@planet.nlwrote in message
news:uH**************@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

<si**********@gmail.comschreef in bericht
news:11*********************@74g2000cwt.googlegro ups.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



Aug 24 '06 #8

P: n/a
"Cor Ligthert [MVP]" <no************@planet.nlschrieb:
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/>

Aug 24 '06 #9

P: n/a
>
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
Aug 24 '06 #10

P: n/a

Greg wrote:
"Tom Shelton" <to*@mtogden.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...

si**********@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
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

Aug 24 '06 #11

P: n/a
>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
Aug 24 '06 #12

P: n/a
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
Aug 24 '06 #13

P: n/a
"Tom Shelton" <to*@mtogden.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
>
Greg wrote:
>"Tom Shelton" <to*@mtogden.comwrote in message
news:11**********************@m79g2000cwm.googleg roups.com...
>
si**********@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

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.
Aug 25 '06 #14

P: n/a

Greg wrote:
"Tom Shelton" <to*@mtogden.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...

Greg wrote:
"Tom Shelton" <to*@mtogden.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...

si**********@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
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

Aug 25 '06 #15

P: n/a
Jim,

I agree if you have selected that button, but on the other hand, do I not
like those programs anymore that if I think to do a really enter. That enter
is in my idea still from terminals as the VT100 (Unix Terminals) or the 3270
on IBM mainframe, which sends a full screen.

Cor

"Jim Wooley" <ji*************@hotmail.comschreef in bericht
news:24*************************@msnews.microsoft. com...
>>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


Aug 25 '06 #16

This discussion thread is closed

Replies have been disabled for this discussion.