public static XtraForm CreatePreviewForm(string title, string html)
 {
     var form = new XtraForm {
         Text = title,
         FormBorderStyle = FormBorderStyle.SizableToolWindow,
         Size = new Size(800, 600),
         StartPosition = FormStartPosition.CenterParent,
     };
     var browser = new CopyableWebBrowser {
         Dock = DockStyle.Fill,
         AllowNavigation = false,
         AllowWebBrowserDrop = false,
         DocumentText = html,
         IsWebBrowserContextMenuEnabled = false,
         WebBrowserShortcutsEnabled = false
     };
     form.Controls.Add(browser);
     return form;
 }
Пример #2
0
        public static XtraForm CreatePreviewForm(string title, string html)
        {
            var form = new XtraForm {
                Text            = title,
                FormBorderStyle = FormBorderStyle.SizableToolWindow,
                Size            = new Size(800, 600),
                StartPosition   = FormStartPosition.CenterParent,
            };
            var browser = new CopyableWebBrowser {
                Dock                           = DockStyle.Fill,
                AllowNavigation                = false,
                AllowWebBrowserDrop            = false,
                DocumentText                   = html,
                IsWebBrowserContextMenuEnabled = false,
                WebBrowserShortcutsEnabled     = false
            };

            form.Controls.Add(browser);
            return(form);
        }