473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Aug 24 '06 #1
15 12503
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

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

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
"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
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
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
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
"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
>
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

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
>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
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
"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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What...
3
by: C# Learner | last post by:
Is it possible to set a command button to the "default" button of the form? Here's an example of what I mean -- press Start -> Run. Notice that the "OK" button has a dark rectangle around it,...
5
by: Hendrik Schober | last post by:
Hi, we just run into the problem, that "default" alignment in the project properies dialog seem to be different. We have a project that's a DLL, which is linked with a couple of LIBs. All are...
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
3
by: per9000 | last post by:
Hi, can I print some default text on the console when doing a ReadLine? A silly example below shows two small scenarios. In the first a user is told what he appears to be called, and asks for a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.