Hide Table of Contents
OnClose Method (IPropertyManagerPage2Handler5)

Obsoleted. Superseded by IPropertyManagerPage2Handler6::OnClose.

.NET Syntax

Visual Basic (Declaration) 
Sub OnClose( _
   ByVal Reason As System.Integer _
) 
Visual Basic (Usage) 
Dim instance As IPropertyManagerPage2Handler5
Dim Reason As System.Integer
 
instance.OnClose(Reason)
C# 
void OnClose( 
   System.int Reason
)
C++/CLI 
void OnClose( 
&   System.int Reason
) 

Parameters

Reason

Reason this method is called as defined in swPropertyManagerPageCloseReasons_e

Remarks

This handler method is called when the PropertyManager page is about to close.  

 

SOLIDWORKS controls when add-ins can do work. An add-in is unable to do any real work within the PropertyManager2Handler5::OnClose handler because the PropertyManager page and command are closing. So, typically the IPropertyPage2Handler5::AfterClose handler is called after IPropertyManager2Handler5::OnClose to allow an add-in to do work. However:

 

If PropertyManager page is...

And you implemented the handler in...

Then you...

Not pinned

C++

Can prevent the PropertyManager page from closing by setting the HRESULT return value to S_false.

 

Visual Basic

Should use the Err.Raise method with a value of 1 to prevent the PropertyManager page from closing. In VB.NET, use 0 with Err.Raise.

 

NOTE:  When control returns to SOLIDWORKS:

  • The IPropertyManager page remains displayed on the screen.

  • The IPropertyManagerPage2Handler5::AfterClose handler is not called.

Pinned

C++ or Visual Basic

Set HRESULT to S_false to close the PropertyManager page (i.e., ignore the fact that the page is pinned).

This allows your add-in to call the IPropertyManagerPage2Handler5::AfterClose handler and do its work. To avoid aggravating your user, who expected the PropertyManager page  to remain pinned, you should re-display and re-pin the PropertyManager page after the add-in finishes its work.

 

NOTE: In a previous version of this method, IPropertyManagerPage2Handler3::OnClose, if the user clicked the Cancel button and the PropertyManager page had a pushpin, then this method returned swPropertyManagerPageClose_Closed. This version of this method returns swPropertyManagerPageClose_Cancel in this scenario.

 

See Also

Availability

SOLIDWORKS 2008 FCS, Revision Number 16.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   OnClose Method (IPropertyManagerPage2Handler5)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:



x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2015 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.