My goal is to add the new tabpage on the navigation pannel. I searched the forum for creating customer navigation. I used the PDViewCS_2008 as my test project. I declared the CUSTOM_NAV in PDFViewForm.cs. When the project run, I got the error, “system.NullReferenceException: Object reference not set to an instance of an object.\r\n at PDFViewCS.PDFViewForm.OpenPDF(String filename)” on the code, bookmark_tree.BeginUpdate().
My questions:
1. Do I miss anything that made me to have this error. If so, would you tell me what I miss.
2. Would you tell me what should do to add a new tabpage on the navigation. I also need the book mark and layer panel as like the build-in pannel on the sample.
The following is the code snippet for on PDFViewForm.cs file in PDViewCS_2008 project.
#if CUSTOM_NAV
// Populates a custom bookmark tree control with bookmark nodes (if any).
Bookmark root = _pdfdoc.GetFirstBookmark();
if (root.IsValid())
{
bookmark_tree.BeginUpdate();
BuildBookmarkTree(root, bookmark_tree.Nodes);
bookmark_tree.EndUpdate();
}
else
{
// Optional: Uncomment the following line to hide the bookmark
// tab if the document does not containing bookmarks?:
// _pdfdoc_tab.Hide();