Focus on EpiDockManagerPanel vs. EntityGLCPanel

Wonder if anyone can tell me why switching focus is not working the same between native panels and those added via the sheet wizard?

I have been able to consistently switch the focus to a standard panel thru code right without doing anything extra after the form loads.
Sheet wizard panels on the other hand are requiring me to manually selected that custom sheet at least once (EpiDockManagerPanel) before I can get the focus to start switching via code.

thanks in advance


private void SetFocus_SheetWizardSheet()
{
/// Works ONLY AFTER I have previously switched to the custom sheet manually at least once
/// Sheet Wizard panel
Ice.Lib.Framework.EpiDockManagerPanel rm = (Ice.Lib.Framework.EpiDockManagerPanel)csm.GetNativeControlReference(“05109c6a-662b-4927-a635-5b1220f8a972”);
rm.Focus();
/// TextBox
EpiTextBox txtMtlMtlType = (EpiTextBox)csm.GetNativeControlReference(“f77b0846-34f1-4988-8bea-5cd1e76b0d77”);
txtMtlMtlType.Focus();
}


private void SetFocus_StandardPanel()
{
// This seems to work consistently right after loading the form
Erp.UI.App.GLControlPanels.EntityGLCPanel gl = (Erp.UI.App.GLControlPanels.EntityGLCPanel)csm.GetNativeControlReference(“dcc39723-184f-4719-afa5-4aeed95c131b”);
gl.Focus();
// TextBox
EpiTextBox txtGLControlType = (EpiTextBox)csm.GetNativeControlReference(“7b658a83-6d71-465e-8bb3-b34d67928dba”);
txtGLControlType.Focus();
}


Maybe you could force it by setting the
string EpiSelectedSheet property?

If you want the current sheet name, read that property.

@bordway You can do something like this in the form load. This example uses Job Status Maintenance and the GUID is from MainPanel1 which has 3 standard tabs (Indexes) (0 - 2) and two custom (3 & 4). I would recommend finding the tab index by name to make it foolproof. The example below sets the focus to my custom tab (4).

EpiBaseForm form = sender as EpiBaseForm;
form.ActiveControl = CustomSheet; // Name of custom sheet
Ice.Lib.Framework.EpiDockManagerPanel mp = (Ice.Lib.Framework.EpiDockManagerPanel)csm.GetNativeControlReference("1dff11bc-3024-4d17-acfc-b7af287e274b");
mp.baseDockManager.ControlPanes[4].IsSelectedTab = true;

How do you know which number the tab is. @danbedwards you reference the index numbers but I don’t know where to find those?