SetDocumentProperty 'NoClose' of single tab in mdi mode

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

SetDocumentProperty 'NoClose' of single tab in mdi mode

Post by MartinCS »

Hi all,

I'm using the 'SetDocumentProperty' method to set the attribute 'NoClose' of an opened document tab. I'm trying to gain the feature that only the currently activated tab holds the X icon to close the current document. My problem is that the document receives the modified flag 'true' after I set the 'NoClose' attribute.

Is it possible to use the 'SetDocumentProperty' method without being the document ui being affected. I used the fourth parameter of the 'SetDocumentProperty' to set the PXCVA_Flags. I also tried a combination with setting the modified flag after changing the 'NoClose' flag. Please see code below. Both ways are with no success. I hope you have an advice for me.

Thank you,
Martin

code snippet using 'NoClose' & 'Modified' combination:

Try
modMisc.frmMain.AxCoPDFXCview1.SetDocumentProperty(pdf.DocumentWindowID, "NoClose", 0, 0)

' set document modified flag back only if pdf hasn't been changed by user
If Not (pdf.DocumentModified) Then
modMisc.frmMain.AxCoPDFXCview1.SetDocumentProperty(pdf.DocumentWindowID, "Modified", "False", 0)
End If

Catch ex As Exception
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex))
Exit Sub
End Try
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: SetDocumentProperty 'NoClose' of single tab in mdi mode

Post by Vasyl-Tracker Dev Team »

Hi Martin

I cannot reproduce this behavior here - maybe it exists for another reason:
please check the code in your OnEvent handler - could it be the document has changed when you received the EventType=XCVA_OnPropertyChanged?

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: SetDocumentProperty 'NoClose' of single tab in mdi mode

Post by MartinCS »

Hi Vasyl,

I reviewed my code and it works now perfectly.


Thank you,
Martin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: SetDocumentProperty 'NoClose' of single tab in mdi mode

Post by Tracker Supp-Stefan »

Hello Martin,

Glad to hear you found and fixed the problem!

Cheers,
Stefan
Post Reply