473,803 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to go to the next control?

I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on A.
When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl (A).

Please help
Benson.
VB2005
Jan 15 '07 #1
4 4591
Benson,

Strange why do you not know the Control name, don't you have the source?

The next control is the control with the next tab index.

Cor

"Benson" <be*******@yaho o.com.hkschreef in bericht
news:eo******** *******@TK2MSFT NGP03.phx.gbl.. .
>I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on
A. When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl (A).

Please help
Benson.
VB2005

Jan 15 '07 #2
What he is saying is that every control has a tab Index property.
Set these up for every control that you want to be focused on, in the
order that you want.
Then use that index to move from one control to the next.
Benson wrote:
I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on A.
When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl (A).

Please help
Benson.
VB2005
Jan 15 '07 #3
Is this a web application or a windows forms?
If it's windows forms, then this is rather simple.
if its a Web application, you will need to use javascript to navigate
from one control to the next using javascript's Focus() function.

let me know if you need any other help...

regards,

Sorcerdon
Sorcerdon wrote:
What he is saying is that every control has a tab Index property.
Set these up for every control that you want to be focused on, in the
order that you want.
Then use that index to move from one control to the next.
Benson wrote:
I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on A.
When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl (A).

Please help
Benson.
VB2005
Jan 15 '07 #4
"Benson" <be*******@yaho o.com.hkschrieb :
>I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on
A. When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl (A).
Check out the form's 'SelectNextCont rol' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 15 '07 #5

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

Similar topics

4
9535
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab pages (one page at the end for collecting identifying information) on my form. To ease the task for the user, I'd like to have an automatic movement to the next page. For instance, when the user clicks on the choice for Question 4 (the last of...
2
5897
by: David Kao | last post by:
HI All: I am currently implementing a TextBox to allow user to type the things the user wants to search. The actual search routine is happening on Textbox Validated event. My user wants me trap enter key in the Search TextBox, so that after the user complete their search string. The user can either press enter key or shift the focus to next control. The problem I am facing I cannot easily find out what is my next tab control on my win...
2
2343
by: Mad Scientist Jr | last post by:
I have autopostback turned on for Textbox1. When the user tabs out of it, the codebehind recalculates some other fields based on its value, and the user should be able to start typing a value in the next control Textbox2. However, when the page is rendered, the focus goes back to Textbox1. In order to go to the next control the user has to hit tab twice - once to recalculate, and once to tab out of the control. Is there some way to make it...
4
4808
by: chreo | last post by:
I assume that it is not hard problem. I would like user to only click in datagrid to select whole row - DONE I would like user to select whole row using UP and DOWN arrows. - DONE. And I would like to move to the next control with TAB key! TAB key in datagrid moves between colums... I don't TAB do change colums - I want TAB to move to next control - or previous with SHIFT+TAB...
3
7224
by: chreo | last post by:
Hello. I have datagrid. I found code to select all row in data grid (by mouse or arrow keys). This works great - user can select row and... ....and I want to go to next control. For example: User writes something in textbox - then hits TAB to go to datagrid...
4
1783
by: Vayse | last post by:
I have a text box, with a command button next to it. When the button is pressed, I want to run some code. Then pass the focus to the next control. How do I do this? Thanks Vayse
4
6931
by: praveen | last post by:
I have a form with treeview control loaded from xml document,text box, two buttons named "Find" and "FindNext" and my treeview which looks like below. Details |__ policy status |__ created by |__ cover type
8
10847
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
16
4021
by: pupilstuff | last post by:
hi guys i just want to perform custom paging in which at the footer of the grid view ,there must be a pager 'pervious/next with numeric' this is what i did in aspx page <asp:GridView ID="TableGridView" OnPageIndexChanging="TableGridView_PageIndexChanging" runat="server" AutoGenerateColumns="False"
0
10546
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
10310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
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
7603
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
6841
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
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
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
2970
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.