2.1.5 CanClose


Description

When Origin is connected to another application via COM, you can no longer close down Origin until the controlling application terminates. The CanClose property when set to true (default is false) will make Origin hidden when user click the x button to close Origin. So this properly is essentially Hide-On-Close.

Syntax

VB: Property Get/Let CanClose As Boolean
C++: bool CanClose
C#: bool CanClose

Parameters

Remark

Examples

VB

    Sub CanClose()
        Dim app As Origin.IOApplication
        app = New Origin.ApplicationSI
        app.Visible = Origin.MAINWND_VISIBLE.MAINWND_SHOW

        If app.CanClose Then
            MsgBox("You can close the Origin instance by click the \'X\' on the title bar of the window.")
        Else
            app.CanClose = True
            MsgBox("By setting CanClose as true, you can close Origin now.") 'just hide it.
        End If
    End Sub

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
pageName = app.CreatePage(app.OPT_WORKSHEET)
print("CanClose ? " + app.CanClose)

Version Information

8.0SR2

See Also