Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

Return key causes system sound

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheNortonZ - 10 Dec 2004 00:57 GMT
I have a requirement where when the user is in an edit field, they should be
able to hit Enter(return).

When I do this, my system makes a noise as though an illegal entry has been
made.

Is there a reason it is doing this and is there a way to change it?

Thanks.

STom
Robby - 10 Dec 2004 04:25 GMT
Having the TextMode set to SingleLine will cause this behaviour.  Users
should hit the [Tab] key to move to the next field.  You can extend the
TextBox class so that it responds to [Enter] as if [Tab] was hit. I think it
would be a better idea simply to get them to start using [Tab] as this is
the norm for Windows apps.

Robby

>I have a requirement where when the user is in an edit field, they should
>be able to hit Enter(return).
[quoted text clipped - 7 lines]
>
> STom
TheNortonZ - 10 Dec 2004 13:10 GMT
Yes, I agree that it is normal in every Windows application in the entire
universe to do TAB. Unfortunately when you have whiney a#$ people who have
lived on mainframes or worse yet have only ever used Excel....you have to
give them the ability to hit enter to do something in the field.

I'm just going to let it beep at them. Hopefully it will drive them crazy
enough to move into the 21st century and use the tab key.

Thanks for the info though!

STom

> Having the TextMode set to SingleLine will cause this behaviour.  Users
> should hit the [Tab] key to move to the next field.  You can extend the
[quoted text clipped - 15 lines]
>>
>> STom
Robby - 10 Dec 2004 22:28 GMT
Well they are not on mainframes or in Excel so they need to learn the new
way for doing things.  Don't give in.  They need to upgrade.

:)

Robby

> Yes, I agree that it is normal in every Windows application in the entire
> universe to do TAB. Unfortunately when you have whiney a#$ people who have
[quoted text clipped - 27 lines]
>>>
>>> STom
TheNortonZ - 10 Dec 2004 13:12 GMT
Oh, but just in case I do decide to extend it, what do I override to get
this to happen?

STom

> Having the TextMode set to SingleLine will cause this behaviour.  Users
> should hit the [Tab] key to move to the next field.  You can extend the
[quoted text clipped - 15 lines]
>>
>> STom
Robby - 10 Dec 2004 22:55 GMT
Extending the TextBox consist of making a control and having it inherit from
System.Windows.Forms.TextBox instead of System.Windows.Forms.Control. In its
KeyPress event you can check if [Enter] was pressed and send [Tab] instead.
You should also restrict the TextMode property to SingleLine because this
extended TextBox will never be able to hold multiline text.  Then you need
to use this control in place of the TextBox control.

HOWEVER, there is a much bigger problem.  If they do not learn to hit [Tab]
instead of [Enter] to move to the next control then you will have to extend
EVERY control (MS controls and 3rd party controls) to this behavior. You
will basicly loose all the [Enter] key functionality of all your controls.
Look at the multiline problem above. This is total madness.

Every control expects [Tab] to move to a the next control.  This is the
normal behavior in windows programs. Do you see the problem you will create
if you allow this to persist.  The cost developement, debugging, supporting,
... EVERYTHING goes skyward very quickly.  This [Enter] extension may seem
cute on the form you are working on now BUT they will expect this
functionality on EVERY form and EVERY application you design.  Start to add
ComboBoxes, CheckBoxes, ListBoxes, DataGrids, other MS and 3rd party
controls that deal with [Enter] differently than they deal with [Tab].  You
will basicly loose all the [Enter] key functionality of all your controls.
Look at the multiline problem above.  Do you see what you are getting
yourself into.

They must upgrade their skills when moving to a new system.  Hitting [Tab]
instead of [Enter] is not rocket science.  They can't expect to move to a
new system and do everything the old way.

Robby

PS.  hummm ... I just though of something.  You could KeyPreview on the form
and send [Tab] when enter is pressed.  That would simplify it.  But it will
lead to other problems.  Don't let them know that.  Press the expensive to
develope and support line I rambled on about above.  Ramble on about the
increased cost for current and future developement of the system.

End Users:  Can't live with them, can't get rid of them with out people
asking lots of questions.

################

> Oh, but just in case I do decide to extend it, what do I override to get
> this to happen?
[quoted text clipped - 20 lines]
>>>
>>> STom
Robby - 10 Dec 2004 23:23 GMT
Oh I just though of something else.  In the KeyPreview your could switch the
[Enter] and [Tab] keys.  When they hit [Enter] send [Tab] and when they hit
[Tab] send [Enter].  Still they will have to learn to hit [Tab] for the
[Enter] functionality and [Enter] for the [Tab] functionality.  Silly isn't
it.  So since they have learn something new anyway they might as well learn
to hit [Tab] for [Tab] functionality and [Enter] for [Enter] functionality.

The end result is the end users, while they sometimes know what they want
they almost never know what they need.  It is up to us to analyse the
situation and developed the best solution.  Stress to them that the
mainframe app has almost no user interface and that Excels user interface,
the worksheet, is tightly controlled.  Let them know that if they want the
added power and flexibility of the application that they will have to learn
the new user interface interactions.

Robby

> Extending the TextBox consist of making a control and having it inherit
> from System.Windows.Forms.TextBox instead of System.Windows.Forms.Control.
[quoted text clipped - 63 lines]
>>>>
>>>> STom

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.