Classic Customization Freezes After Focus()

So, I gave up trying to make the UD101 Kinetic form do what I needed, but that’s another story.

I’m working in the classic form now. I’ve installed a grid on the header tab so I’ll have everything in one place. It works fine until I add a new record.

When I do that, focus goes to the Child/Detail tab and to the ChildKey1 text box. I want it to go back to the header tab, so I’ve done something like this:

	private void txtChildKey1_Enter(object sender, System.EventArgs args)
	{
		txtHeatNum.Focus();
		//detailPanel1.Focus();
		//detailPanel1.Show();
		MessageBox.Show("in the text box");
	}

I’ve tried sending focus to the grid, the detail panel, and to a specific text box on the header. That part works fine, too, except that now the screen stops responding and I have to kill Epicor.

After the Focus() line, I’ve tried also tried Show() and Select() without effect.

Recommendations?

Thanks,

Joe

Events run on a different thread than main try setting the focus on the event by using invoke on the main form

Like this

UD101Form. Invoke((ThreadStart)delegate()
{
//modify UI elements here
TextBox1.Focus();
});

Jose,

I’m probably not putting it in the right spot and am getting the same result. Like this?

private void txtChildKey1_Enter(object sender, System.EventArgs args)
{
	//txtHeatNum.Focus();
	//detailPanel1.Focus();
	//detailPanel1.Show();
	//MessageBox.Show("in the text box");

	UD101Form.Invoke((ThreadStart)delegate()
	{
		txtHeatNum.Focus();
	});
}

Thanks,

Joe

Yes like that but I just realized you made it so that when the mouse enters it focuses… that doesn’t make a lot of sense it’s going to go into a crazy loop me thinks

Boy, I tried every event on that text box I thought might be in the neighborhood of happening after the focus, with similar results.

Then I thought, “Why don’t I just do an after tool click for a new child record?”

Ah, well.

Thanks, Jose.

Joe