473,770 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2433
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************* *@exisconsultin g.com

"tor" <to******@hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.KeyDo wn 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.F ocus() and set
e.Handled to true.

Chris

"tor" <to******@hotma il.com> wrote in message
news:#c******** ******@TK2MSFTN GP11.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******@hotma il.com> wrote in news:#cninj6cDH A.3948
@TK2MSFTNGP11.p hx.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******@hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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
14350
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? Basically: "Press any key to continue..." I beleive that I am looking for is something along the lines of a....
4
3867
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 best way to do that? TIA current code: do {
5
3518
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; Response.Form.GetEnumerator(), etc. while, identifying specific controls by programmatically assigned unique id (e.g. MyButton_AnswerID_123). However, I am not sure if that is the proper way. What is the common practice?
6
4901
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
10
2048
by: Chad | last post by:
Given: #include <stdio.h> #include <stdlib.h> #define MAXLINE 200 int main(void) { char buff;
14
3473
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: onkeyup="document.getElementById('javao').innerHTML=this.value;" And this : <span id="javao"></spansomewhere else on the page.
0
9432
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7420
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.