When a web form loads, how can I make the cursor start in a specific text box?

If you want the cursor to start in a specific text box, add the following line of code in your application:

C#

this.FIELDNAME.Focus();

VB

Me.FIELDNAME.Focus

You could add it to the page load function as follows:

C#

protectedvoidPage_Load(objectsender,EventArgse){switch(this.CurrentWorkflowActionName){caseINITIATES://IfcurrentactionisINITIATES,dosomeworkthis.FIELDNAME.Focus();break;caseAPPROVES://IfcurrentactionisAPPROVES,dosomework//writecodeherebreak;}}

VB

ProtectedSubPage_Load(ByValsenderAsObject,ByValeAsEventArgs)SelectCase(Me.CurrentWorkflowActionName)CaseINITIATES'IfcurrentactionisINITIATES,dosomeworkMe.FIELDNAME.FocusCaseAPPROVES'IfcurrentactionisAPPROVES,dosomework'writecodehereEndSelectEndSub