473,399 Members | 3,038 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,399 software developers and data experts.

Using <Enter> or <NewLine> key instead of Tab

tor
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn
Nov 15 '05 #1
6 2409
Any particular reason why you wanna do that?

Benny

tor wrote:
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn


Nov 15 '05 #2
Torfinn,

In order to do this you can capture when the key that you want to shift
focus is pressed (using an event, overriding the WndProc method, etc, etc).
When the event that is supposed to shift the focus occurs, call the
GetNextControl method on the current control and then call Focus on the
control returned.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"tor" <to******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn

Nov 15 '05 #3
The best solution is probably to handle the myTextBox.KeyDown event, check
the KeyCode property on the event argument, and if it's KeyCode.Enter, set
the focus on the next text box you want with myNextTextBox.Focus() and set
e.Handled to true.

Chris

"tor" <to******@hotmail.com> wrote in message
news:#c**************@TK2MSFTNGP11.phx.gbl...
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn

Nov 15 '05 #4
"Paul E Collins" <fi******************@CL4.org> wrote:
Or, instead of doing this for each control on the form,
set Form.KeyPreview = true and do something like the
above in Form_KeyDown.


Btw, ProcessTabKey would be helpful here.

P.

--
www.CL4.org
Nov 15 '05 #5
"tor" <to******@hotmail.com> wrote in news:#cninj6cDHA.3948
@TK2MSFTNGP11.phx.gbl:
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn


http://www.syncfusion.com/faq/winforms/search/902.asp

FB

--
Solutions Design : http://www.sd.nl
My open source .NET Software : http://www.sd.nl/software
My .NET Blog : http://weblogs.asp.net/FBouma
-------------------------------------------------------------------------
Nov 15 '05 #6
I needed to do this for a client recently to allow really fast data entry on
a form:

Set the KeyPreview property on the form to 'true'

Add the following code to the KeyPress event of the Form:

if(e.KeyChar == (char)13)
{
SendKeys.Send("{TAB}");
}

---
Steven Wood

"tor" <to******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello
How can I use an other key then TAB to move from
one textBox to another??

Torfinn

Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
4
by: aurgathor | last post by:
I have a code that reads in 2 shorts, and checks if they are in a given range. I'd like to modify it to use a predefined default value if nothing, but as newline is entered. What would be the...
5
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator;...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
10
by: Chad | last post by:
Given: #include <stdio.h> #include <stdlib.h> #define MAXLINE 200 int main(void) { char buff;
14
by: EnjoyNews | last post by:
Hi I have a little probelm. I tranfer som data from input fields to a div so you can see how a profil will look as you type in your data. I just put this in my input field:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.