using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private const string veryPDFOCXRegistrationCode = "XXXXXXXXXXXXXX";
        private void Form1_Load(object sender, EventArgs e)
        {
            axPdfocxMarkup.SetOrderID(veryPDFOCXRegistrationCode, null, null);

            axPdfocxMarkup.MainToolbarHideButton(32772, true);
            axPdfocxMarkup.MainToolbarHideButton(32774, true);
            axPdfocxMarkup.MainToolbarHideButton(32773, true);
            axPdfocxMarkup.MainToolbarHideButton(32776, true);
            axPdfocxMarkup.MainToolbarHideButton(32777, true);
            axPdfocxMarkup.MainToolbarHideButton(32778, true);
            axPdfocxMarkup.MainToolbarHideButton(32779, true);

            axPdfocxMarkup.MainToolbarHideButton(32877, true);
            axPdfocxMarkup.MainToolbarHideButton(32878, true);
            axPdfocxMarkup.MainToolbarHideButton(32787, true);
            axPdfocxMarkup.MainToolbarHideButton(32788, true);
            axPdfocxMarkup.MainToolbarHideButton(32789, true);

            axPdfocxMarkup.MainToolbarHideButton(32790, true);
            axPdfocxMarkup.MainToolbarHideButton(32791, true);
            axPdfocxMarkup.MainToolbarHideButton(32792, true);
            axPdfocxMarkup.MainToolbarHideButton(32793, true);

            tabControl1.SelectedTab = tabPage2;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openExtensFile = new OpenFileDialog();
            openExtensFile.Title = "PDF";
            openExtensFile.InitialDirectory = @"c:\";
            openExtensFile.Filter = "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*";
            openExtensFile.FilterIndex = 0;
            openExtensFile.RestoreDirectory = true;
            if (openExtensFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            bool bRet = axPdfocxMarkup.OpenPDFFile(openExtensFile.FileName, "", "", 0);
            axPdfocxMarkup.ShowLeftPanel(true);
            int refPara = 0;
            axPdfocxMarkup.InvokeMethod(42, 1, ref(refPara));
            string strDefaultFolder = "c:\\windows";
            //axPdfocxMarkup.InvokeMethodEx(229, 1, strDefaultFolder);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int nModify = 0;
            axPdfocxMarkup.InvokeMethod(71, 0, ref(nModify));
            if (nModify != 0)
            {
                MessageBox.Show("PDF file has been modified!");
            }
            axPdfocxMarkup.ClosePDFFile();
        }
               

        private void Form1_Resize(object sender, EventArgs e)
        {
            tabControl1.Height = this.Height - 100;
            tabControl1.Width = this.Width - 2 * tabControl1.Left;
        }
  
    }
}