예제 #1
0
 void browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     browser.PageSettings.Margins.Bottom = 0;
     browser.PageSettings.Margins.Left   = 0;
     browser.PageSettings.Margins.Right  = 0;
     browser.PageSettings.Margins.Top    = 0;
     browser.Print();
 }
예제 #2
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());
            }
        }