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

Using Arrow buttons instead of Tab to toggle between Textboxes

Hi..
I wanna use down arrow and up arrow to move between TextBoxes(that are Dynamically created) instead of the default Tab key.. Please help me if u ve any idea.. Thanks
Oct 21 '08 #1
4 1748
Curtis Rutland
3,256 Expert 2GB
You will have to handle the KeyDown event for each textbox, and check to see if the keys are one of the arrow keys, and then .Focus() on the appropriate textbox.
Oct 21 '08 #2
but its dynamically created.. how can i make changes in tat.

here s the code.. pls help me figure out

Expand|Select|Wrap|Line Numbers
  1. Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
  2.  
  3. If IsPostBack Then
  4.  
  5. Try
  6.  
  7. If Not TextBox1.Text Is String.Empty Then
  8.  
  9. numofper = TextBox1.Text
  10.  
  11. ReDim TxtDyn1(numofper)
  12.  
  13. ReDim TxtDyn2(numofper)
  14.  
  15. ReDim TxtDyn3(numofper)
  16.  
  17. ReDim TxtDyn4(numofper)
  18.  
  19. Else
  20.  
  21. MsgBox(
  22. "Enter the Number of Periods")
  23.  
  24. End If
  25.  

'To create the dynamic text box and add the controls to panel, save them in session state

Expand|Select|Wrap|Line Numbers
  1. For i As Integer = 0 To numofper - 1
  2.  
  3. TxtDyn1(i) =New TextBox
  4.  
  5. TxtDyn1(i).EnableViewState =True
  6.  
  7. Panel1.Controls.Add(TxtDyn1(i))
  8.  
  9. textdynamic1.Add(textdynamic1)
  10.  
  11. Next
.
.
.
Oct 22 '08 #3
tlhintoq
3,525 Expert 2GB
The [TAB] key uses an index on the form. You can set the order of movement by setting the Tab Index.

For your want you will have to write a method that scans through all of the controls on your form, get the .Location of each control, then determine which control is "down" from the control that currently has focus.

You'll have to decide which is more important: If a control exists that is lower in location, but far to the left - of a different control that is maybe 2 pixels lower, but not as many pixels away horizontally.
Oct 22 '08 #4
thank you very much..
Oct 22 '08 #5

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

Similar topics

2
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 4 command buttons: Sort Title (cmdSortTitle), Sort Name (cmdSortName), Due Today (cmdDueToday), and Due List (cmdDueList). Sort Title and Sort...
4
by: Neil Wallace | last post by:
Hi there, I have an application in which a grid of 100 or more buttons are put on a form in columns of 10. All the buttons are within a panel. They are added in runtime, and so they adopt a...
2
by: Newbie | last post by:
Could someone help: I have been searching the web trying to figure out a way to use function key's in my vb.net 2003 program (No luck!). What I would like to do is enable the user to press (for...
1
by: perse981 | last post by:
Hi I need to know how, if even possible, to enable the user of my program to control the Size and Posisiton of the circle I have Drawn on the form by using the Enter Key (to increase size), Shift...
1
by: vishwaskothari | last post by:
on my Form there are several buttons present, the problem is that the when i press the arrow key of the keyboard, then instead of going serially the focus moves randomly over those buttons. ...
2
by: Chuck | last post by:
How can I make an array of command buttons (or toggle buttons) on a form and have a text box on the same form display the index of the button clicked? This works very well in VB6, but I can't...
4
by: zufie | last post by:
I have two checkboxes on a form, ChckIBCCP and ChckOtherReferral. Each checkbox highlights its respective textboxes and combo boxes on the form. Many of the highlighted textboxes and combo...
2
by: 6afraidbecause789 | last post by:
Hi - Has anyone ever used toggle buttons to select items in a listbox? I'd like to put about 24 toggle buttons on an unbound form that select or deselect items in a multiple select listbox. I've...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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?
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,...

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.