Cursor Start Position Customization

2021.1.26

I’m starting to work on how to set the default cursor start position when opening a form. One form that I do not have customized yet is Part Transaction History Tracker. By default on our version the cursor is nowhere. We would like it to be on the part field. To be nice I decided to look into this.

Tab Index is already set to 1. I’ll let you know what I find out. Feel free to offer a solution.

image

Trying something like this.

private void PartTranHistForm_Load(object sender, EventArgs args)
{
	// Add Event Handler Code
	Ice.Lib.Framework.EpiTextBox textbox01 = ((Ice.Lib.Framework.EpiTextBox)csm.GetNativeControlReference("46567b2e-6bc0-4967-be35-a0ec6843838f"));
	textbox01.Focus();
}

That’s what I was about to suggest - did it work?

Not yet. Tried this also without success.

private void edvPart_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row][“FieldName”]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
Ice.Lib.Framework.EpiTextBox textbox01 = ((Ice.Lib.Framework.EpiTextBox)csm.GetNativeControlReference(“46567b2e-6bc0-4967-be35-a0ec6843838f”));
textbox01.Focus();
}
}
}

This is the properties of the field.

Oooh i got it! Used Select() instead of Focus()

EpiTextBox txtOrderNum = (EpiTextBox)csm.GetNativeControlReference(“46567b2e-6bc0-4967-be35-a0ec6843838f”);
txtOrderNum.Select();