How to change from one tab or panel to another tab or panel

How to change from one tab or panel to custom tab or panel?
I tried the below code, but it did not work.
Ice.Lib.Framework.EpiBasePanel UHDropShip = (Ice.Lib.Framework.EpiBasePanel)this.csm.GetNativeControlReference(“7394a96e-723b-437e-8147-0dda96d4e9c4”);
UHDropShip.Focus();

The panel UHDropShip is the custom panel/tab I want to get to. Any ideas?

It has been a while, but .Activate() instead of .Focus() ??

I get the below error when I try UHDropShip.Activate();
Error: CS1061 - line 1653 (5423) - ‘Ice.Lib.Framework.EpiBasePanel’ does not contain a definition for ‘Activate’ and no extension method ‘Activate’ accepting a first argument of type ‘Ice.Lib.Framework.EpiBasePanel’ could be found (are you missing a using directive or an assembly reference?)

Sorry. I was trying to go from memory.
It is quite a bit more involved.
You have to get access to the DockManager and then get the control pane and then set the IsSelectedTab property to true. Sample Code (replace “inventoryList” with your panel’s name)

private void SetPaneProperties( System.Windows.Forms.Control.ControlCollection ctls = null)
	{
	// Enumerate the forms controls looking for the Epicor dock manager
		if (ctls == null)
		ctls = oTrans.EpiBaseForm.Controls;

		foreach (Control ctl in ctls) 
		{
			if (ctl.HasChildren)
				SetPaneProperties(ctl.Controls);
	
	
			if ((ctl) is Infragistics.Win.UltraWinDock.WindowDockingArea) 
			{
				object objDockManager = ctl.GetType().InvokeMember("DockManager", BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase, null, ctl, null);
				// Once found get a handle to the Infragistics dock manager using relection
				Infragistics.Win.UltraWinDock.UltraDockManager udm = (Infragistics.Win.UltraWinDock.UltraDockManager)objDockManager;
	
				foreach (Infragistics.Win.UltraWinDock.DockableControlPane p in udm.ControlPanes) 
				{
					if ((p.Key.ToString() == "inventoryList")) 
						p.IsSelectedTab = true;
	
				}
	
			}
		}
	}

I ran the code via a test button and custom panel UHDropShip did not come up. Did I do something wrong? Screen print of the code is attached.

try putting MessageBox.Show(p.Key.ToString());
before the if block to show the names of all the panes the code found to see if your panel is listed…

Just tried that. The custom panel UHDropShip is found and the code p.IsSelectedTab = true is run too.

Should this code display the custom panel UHDropShip automatically?

It Should….

You have reached my limits as a Epicor cutomiser. Perhaps someone far wiser than me can help
J

Solved it. After I added the field.Focus(), before the p.IsSelectedTab = true, it works now.

if ((p.Key.ToString() == “UHDropShip”)) {
cmbUhOrderType.Focus(); //after this is added, we go to Header tab > Detail tab.
p.IsSelectedTab = true; //goes to the UHDropShip tab.
}
Thanks for your help.