Skip to Content
0
Former Member
Mar 26, 2009 at 04:12 PM

Multiple Instance of a Form

32 Views

Hi all,

I am using UDO in a form. This works fine for one instance. But when the user open multiple forms, it gives error. The following is the code to load the form. Please suggest me a method that serve my purpose.

System.Xml.XmlDocument oXmlDoc = null;

oXmlDoc = new System.Xml.XmlDocument();

string sPath = null;

sPath = System.Windows.Forms.Application.StartupPath;

oXmlDoc.Load(sPath + @"\twbs.xml");

string sXML = oXmlDoc.InnerXml.ToString();

SAPbouiCOM.FormCreationParams creationPackage;

creationPackage = (SAPbouiCOM.FormCreationParams)SBO_Application.CreateObject (SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);

creationPackage.UniqueID = "TWBS_Form1";

creationPackage.FormType = "TWBS_Form1";

creationPackage.ObjectType = "TWBS_Form1";

creationPackage.XmlData = sXML;

frmTWBS = SBO_Application.Forms.AddEx(creationPackage);

Thanking you,

Pradeep