set object as active in current container
VB: Function Activate As Boolean
C++: bool Activate
C#: bool Activate
Sub Main() Dim app As Origin.IOApplication Dim strBookName As String Dim wks As Origin.Worksheet app = New Origin.ApplicationSI strBookName = "Data" strBookName = app.CreatePage(Origin.PAGETYPES.OPT_WORKSHEET, strBookName, "w", 2) 'create a worksheetpage and make it visible wks = app.WorksheetPages(strBookName).Layers.Add("sheet") wks.Activate() 'add a new worksheet and set it as active End Sub
public void Activate() { Origin.IOApplication pOrigin; Origin.Worksheet wks; pOrigin = new Origin.ApplicationSIClass(); pOrigin.Visible = Origin.MAINWND_VISIBLE.MAINWND_SHOW; string strBookName = "UserBook"; strBookName = pOrigin.CreatePage((int)Origin.PAGETYPES.OPT_WORKSHEET, strBookName, "W", 2); //create new workbook and make it visible wks = (Origin.Worksheet)pOrigin.WorksheetPages[strBookName].Layers.Add("newSheet", null, null, null, null); //add new sheet and activate it wks.Activate(); } static void Main(string[] args) { Program p = new Program(); p.Activate(); }
8.0SR2