简体   繁体   中英

How can i add tab to SAP B1 SystemForm in Visual Studio?

I wanna add a new tab to SystemForm in SAP B1 Studio for MS Visual Studio.

I am using C#

Simplest approach to this is to catch the System Form's Load event and call a function like the following (this code adds a tab named "My Tab's Name" to the Business Partner form):

    public void BPForm_ItemEvent_Load(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
    {            
        SAPbouiCOM.Button obutton;
        SAPbouiCOM.Item oitem;
        SAPbouiCOM.Item oNewItem;
        SAPbouiCOM.Folder oFolderItem;
        SAPbouiCOM.Form oform;

        oform = HandleSAPB1.SBO_Application.Forms.Item(pVal.FormUID);
        oNewItem = oform.Items.Add("my_tab", SAPbouiCOM.BoFormItemTypes.it_FOLDER);

        oitem = oform.Items.Item("9"); // UI element in the system form to use for positional reference 
        oNewItem.Top = oitem.Top;
        oNewItem.Height = oitem.Height;
        oNewItem.Left = oitem.Left + oitem.Width;

        oFolderItem = oNewItem.Specific;

        oFolderItem.Caption = "My Tab's Name";

        oFolderItem.GroupWith("9");
        oform.PaneLevel = 1;

        UIManager.AddTabElements(oform); // my custom class that adds UI controls to the tab
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM