Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(0).View.DocViewsArea.Panes.Layout
If layout.Root.Count > 0 Then
layout.Root(0).SetStyle(0, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_AddNewTabBtn))
End If
But this does not seem to hide the button??
Also I want it to always be hidden even if only one document is shown, is this possible?
Note, that this will be only available when at least one document is already opened. Best to use this piece of code in the e_document_viewingStarted event.
I did already have this in the e_document_viewingStarted and the event is being caught and the code is running. However the layout.Root.Count is always zero, even if I add documents using the "Add New Tab" button to load the document?
ElseIf e.nEventID = nIDS(CInt(IDS.e_document_viewingStarted)) Then
' Hide add new document button
Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(0).View.DocViewsArea.Panes.Layout
If layout.Root.Count > 0 Then
layout.Root(0).SetStyle(0, CInt(PDFXEdit.UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_AddNewTabBtn))
End If
I have checked the FullDemo and you are correct it works in there, untill you add a 2nd PDF Xchange controls to the FullDemo. Which is what I have in my application, when you have two PDF Xchange controls the layout.Root.Count is always zero
Just FYI the only reason I have another PDF XChange control in my application is to convert MS word and other documents into PDF. Is it possible the convert documents using code without having a control on the form? If so this might solve some issues?
Dim layout As PDFXEdit.IUIX_Layout = Me.docPreview.Inst.MainFrm(1).View.DocViewsArea.Panes.Layout
Also, the conversion itself does not need a control available - only the IPXV_Inst with the needed plugins, so basically, if you don't want to show the conversion results or something then you should only use the operations and the IPXC_Document as their output that you can later open in the main control.