473,945 Members | 4,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmaticall y move to next tab stop

balabaster
797 Recognized Expert Contributor
How do you programmaticall y shift focus to the next tab stop? i.e. I have a bunch of textboxes that all have their tab orders set in sequence. The user hits enter as they finish entering data in any of them, I want to programmaticall y move the user to the next textbox in the sequence.

Right now I'm using sendkeys to send the tab character, but there's just something about it I don't like...it seems kind of hokey. Is there a managed function call that I've missed somewhere?

Something of the style "Form1.Controls .NextControl.Se tFocus" (yes, I know this isn't a valid call, it was just an example)

Any ideas? Is there any other way to do this other than SendKeys?

It seems obvious that you grab the tab index of the current control, increment it to the next number, but then you need to grab the control that has tabstop marked as true and has the next tabindex. Is there an simple way of grabbing the list of tabstopped controls, or does this have to be achieved programmaticall y too?
Mar 14 '08 #1
5 22369
VBWheaties
145 New Member
Dont think there is a native method.
However, it was easy enough to write something.
Just send in your controls tabindex and it will set focus to the next controls tabindex.
Expand|Select|Wrap|Line Numbers
  1.     Public Sub NextControl(ByVal ctrlTabIndex As Integer)
  2.         For Each ctrl As Control In Controls
  3.             If (ctrl.TabIndex) = (ctrlTabIndex + 1) Then
  4.                 ctrl.Focus()
  5.             End If
  6.         Next
  7.     End Sub
  8.  
Mar 14 '08 #2
Plater
7,872 Recognized Expert Expert
There is.
Take a look at:
Expand|Select|Wrap|Line Numbers
  1. this.SelectNextControl(TheCurrentControl,true,true,(either true or false),(either true or false));
  2.  
All controls have the SelectNextContr ol() function that takes a control as a starting point then either looks for the next or previous control by tabstop
Mar 14 '08 #3
VBWheaties
145 New Member
There is.
Take a look at:
Expand|Select|Wrap|Line Numbers
  1. this.SelectNextControl(TheCurrentControl,true,true,(either true or false),(either true or false));
  2.  
All controls have the SelectNextContr ol() function that takes a control as a starting point then either looks for the next or previous control by tabstop
hey now, why didnt i know that? see, now I know why I come here.
Mar 14 '08 #4
balabaster
797 Recognized Expert Contributor
There is.
Take a look at:
Expand|Select|Wrap|Line Numbers
  1. this.SelectNextControl(TheCurrentControl,true,true,(either true or false),(either true or false));
  2.  
All controls have the SelectNextContr ol() function that takes a control as a starting point then either looks for the next or previous control by tabstop
I somehow knew that you would know the answer to that...I don't know why I don't have your direct email address :oP
Mar 14 '08 #5
BAKUL TRIVEDI
1 New Member
Thanks Plater.
Great. It is very much useful.

@Plater
Sep 25 '13 #6

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

Similar topics

2
8808
by: Anand Ganesh | last post by:
Hi All, How to Implement Move Next, Move Previous, Last Record and First Record in a DataGrid Control ? Is there any standard tool available in the tool box button? Thanks for your time. Regards Anand Ganesh
2
1804
by: Mat | last post by:
in my program options, users can reorder DB grid columns( in listbox) Then, i want to programmatically simulate col move event and reorder the columns. Help plz
2
3439
by: solar | last post by:
Is there a command in VB with which to move to the next row in the table of Access database ? For example my table TblCrates consists of : CrateId City 1. Berlin I need a command in VB with which to go to the next row, in the case the CrateId will be 2
2
5605
by: ashasprabhu | last post by:
hai, How to move records to next and previous in asp.net as we do in VB6.0
55
3679
by: indhu | last post by:
HI all one sequence has many panels. when i select combo it displays all the fields but panel has more rows. i want to view that also. how to do that? move next and previous commds are there but not working. pls help me with coding here goes my coding
3
14452
by: dianaj86 | last post by:
I have multiple dropdownlists each one filled with values from a specific column in the table. Also I have multiple textboxes corresponding to dropdownlists. For example, when I select an item from dropdownlistA, all the textboxes are filled with the first row values that contains that selected item and gives the number of rows containing this value……. In addition, I have 2 buttons one is Move Forward Button and the other is Move Previous…I am...
10
2746
by: fran7 | last post by:
Hi, Anyone know the simplest solution to add a next record link. I have this <a href="page.asp?author=<%=rsCard("author")%>">link</a> I am on a page with one record and want a link to go to the next record on the same page and display that. thanks in advance.
0
2818
by: nithyamca | last post by:
Hi.. I want to use enter key to move the next column in datagrid view in vb.net and when ever press the enter key in last cell in grid it create the next row . actually i am hide some cells in datagridview on that time how to move the next visible cell in current working column do. help me
2
3173
by: edcha | last post by:
I have the Next XML var xml = new XElement( "clients", new XElement("client", new XAttribute("id",1), new XElement( "name", "Luis"), new XElement( "country", "Portugal") ), new XElement("client",
0
10149
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9974
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
11548
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
9872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8239
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
7402
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
6093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4927
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
3
3523
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.