0

我想在 SAP B1 Studio for MS Visual Studio 中向 SystemForm 添加一个新选项卡。

我正在使用 C#

4

1 回答 1

1

最简单的方法是捕获 System Form 的 Load 事件并调用如下函数(此代码将名为“My Tab's Name”的选项卡添加到 Business Partner 表单):

    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
    }
于 2016-07-25T13:06:44.183 回答