473,413 Members | 1,989 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,413 software developers and data experts.

How to use Arrow keys similarly like tab in C#,Windows forms

language using: C#.

platform for program: WINDOWS FORM

I have to use arrow keys tro move from one text box to other ,Same as tab..

Is there any way to do this???
Jan 29 '08 #1
2 4115
Plater
7,872 Expert 4TB
Look at the key events for the textbox (key press, keyup, keydown, etc) and handle shuffling focus accordingly
Jan 29 '08 #2
abev
22
language using: C#.

platform for program: WINDOWS FORM

I have to use arrow keys tro move from one text box to other ,Same as tab..

Is there any way to do this???
neehakale this is what I use in vb.net. This is for the down key, but you could set it up for any key or multiple key presses. Maybe you could convert it to C# with the vb.net to c# converter?

Expand|Select|Wrap|Line Numbers
  1.  
  2. If e.KeyCode = Keys.Down Then
  3.             Dim cur_cell As DataGridViewCell = _
  4.                     InsertionOrderDetailDataGridView.CurrentCell
  5.             Dim col As Integer = cur_cell.ColumnIndex
  6.             col = (col + 1) Mod InsertionOrderDetailDataGridView.Columns.Count
  7.             cur_cell = InsertionOrderDetailDataGridView.CurrentRow.Cells(col)
  8.             InsertionOrderDetailDataGridView.CurrentCell = cur_cell
  9.  
  10.             e.Handled = True
  11.         End If
  12.  
This is in the keydown event of the gridview.
Jan 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
0
by: Rud | last post by:
Hello, As soon as I set the form "isMdiContainer = true", the arrow keys are not captured by the forms KeyDown routine anymore. All other keys are nicely captured. When a child form is created...
11
by: Rlrcstr | last post by:
How can you detect when an arrow key gets pressed? Doesn't seem to trigger a KeyPress or KeyDown event. Thanks. Jerry
2
by: anoehre_1 | last post by:
Hi! Very simple Application: ------------------------------- this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
5
by: Rob | last post by:
If I use the following code: Private Sub Form1_KeyDown(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles MyBase.KeyDown Dim myKey As Integer myKey =...
1
by: Martijn Mulder | last post by:
/* I have problems detecting the Arrow Keys on a User Control. A control derived from System.Windows.Forms.Control neglects 'bare' Arrow Keys but does react on the combination <Altor <Ctrl+ Arrow...
0
by: Martijn Mulder | last post by:
/* I override IsInputKey() to direct the Arrow Keys (Cursor Keys) to my custom System.Windows.Forms.Control. But, holding down the Shift-Key prevents the Arrow Keys from coming through. How can...
4
by: boopsboops | last post by:
Hi thescripts people, I hope I'm in the right forum for Visual Basic Dotnet (VS 2005). I am trying to make a custom control in which you can nudge a point around using the arrow keys. Actually,...
2
by: Charles Law | last post by:
I'll kick myself when you tell me, but ... I have a user control on a form, and I want the user control to see the arrow keys when I press them. If I press just about any other key the control's...
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.