Пример #1
0
        void ContextMenu_Click(object sender, EventArgs e)
        {
            string value = (string)(((ToolStripMenuItem)sender).Tag);

            if (value == "Test")
            {
                MessageBox.Show("test!!!", "via Original ContextMenu");
            }
            else if (value == "ViewSource")
            {
                if (browser.DocumentText.Length > 0)
                {
                    SourceViewForm dlg = new SourceViewForm(browser.DocumentText, browser);
                    dlg.Show();
                }
            }
            else if (value == "Print")
            {
                if (browser.DocumentText.Length > 0)
                {
                    browser.Print();
                }
            }
            else if (value == "PrintPreview")
            {
                if (browser.DocumentText.Length > 0)
                {
                    browser.ShowPrintPreviewDialog();
                }
            }
            else if (value == "GoBack")
            {
                browser.GoBack();
            }
            else if (value == "GoForward")
            {
                browser.GoForward();
            }
            else if (value == "Reload")
            {
                browser.Reload();
            }
            else if (value == "CloseTab")
            {
                OnWindowClosing(new EventArgs());
            }
        }