示例#1
0
        public HtmlEditor()
        {
            InitializeComponent();
            // define the default values
            // browser constants and commands
            EMPTY_PARAMETER = System.Reflection.Missing.Value;

            // default values used to reset values
            _defaultBodyBackColor = Color.White;
            _defaultBodyForeColor = Color.Black;
            _defaultFont = new HtmlFontProperty(Font);
            _navigateWindow = NavigateActionOption.Default;
            _scrollBars = DisplayScrollBarOption.Auto;
            _autoWordWrap = true;
            _toolbarVisible = true;
            _statusbarVisible = true;
            _wbVisible = true;
            _bodyText = DEFAULT_HTML_TEXT;
            _bodyHtml = DEFAULT_HTML_TEXT;

            _bodyBackColor = _defaultBodyBackColor;
            _bodyForeColor = _defaultBodyForeColor;
            _bodyFont = _defaultFont;

            // load the blank Html page to load the MsHtml object model
            BrowserCodeNavigate(BLANK_HTML_PAGE);

            // after load ensure document marked as editable
            ReadOnly = _readOnly;
            ScrollBars = _scrollBars;

            SetupComboFontSize();
            SynchFont(string.Empty);
        }
        /// <summary>
        /// Private control constructor defining all default values
        /// </summary>
        public HtmlEditorControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // define the default values
            // browser constants and commands
            EMPTY_PARAMETER = System.Reflection.Missing.Value;

            // default values used to reset values
            _defaultBodyBackColor = Color.White;
            _defaultBodyForeColor = Color.Black;
            _defaultBackColor = SystemColors.ControlLight;
            _defaultFont = new HtmlFontProperty(this.Font);

            // define the default values of the properties
            _readOnly = false;
            _toolbarVisible = true;
            _toolbarDock = DockStyle.Bottom;
            _bodyText = DEFAULT_HTML_TEXT;
            _bodyHtml = DEFAULT_HTML_TEXT;
            _bodyBackColor = _defaultBodyBackColor;
            _bodyForeColor = _defaultBodyForeColor;
            _bodyFont = _defaultFont;
            _scrollBars = DisplayScrollBarOption.Auto;
            _imageDirectory = string.Empty;
            _htmlDirectory = string.Empty;
            _navigateWindow = NavigateActionOption.Default;
            _baseHref = string.Empty;
            _autoWordWrap = true;
            _borderSize = DEFAULT_BORDER_SIZE;
            stylesheet = null;
            script = null;

            // define context menu state and size
            this.BackColor = _defaultBackColor;
            this.contextDocumentToolbar.Checked = true;
            this.contextDocumentScrollbar.Checked = true;
            this.contextDocumentWordwrap.Checked = true;
            SetBrowserPanelSize();

            // load the blank Html page to load the MsHtml object model
            BrowserCodeNavigate(BLANK_HTML_PAGE);

            // after load ensure document marked as editable
            this.ReadOnly = _readOnly;
            this.ScrollBars = _scrollBars;
        }
示例#3
0
        public HtmlEditorControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // define the context menu for format commands
            DefineFormatBlockMenu();

            // define the default values
            // browser constants and commands
            EMPTY_PARAMETER = System.Reflection.Missing.Value;

            // default values used to reset values
            _defaultBackColor = Color.White;
            _defaultForeColor = Color.Black;
            _defaultFont = new HtmlFontProperty(this.Font);

            // set browser default values to hide IE items
            this.editorWebBrowser.AddressBar = false;
            this.editorWebBrowser.MenuBar = false;
            this.editorWebBrowser.StatusBar = false;

            // obtain the underlying web browser and set options
            // SHDocVw.WebBrowser webBrowser = (SHDocVw.WebBrowser)this.editorWebBrowser.GetOcx();

            // define the default values of the properties
            _readOnly = false;
            _toolbarVisible = false;
            _enableVisualStyles = false;
            _toolbarDock = DockStyle.Bottom;
            _bodyText = DEFAULT_HTML_TEXT;
            _bodyHtml = DEFAULT_HTML_TEXT;
            _bodyBackColor = _defaultBackColor;
            _bodyForeColor = _defaultForeColor;
            _bodyFont = _defaultFont;
            _scrollBars = DisplayScrollBarOption.Auto;
            _imageDirectory = string.Empty;
            _htmlDirectory = string.Empty;
            _navigateWindow = NavigateActionOption.Default;
            _baseHref = string.Empty;
            _autoWordWrap = true;
            stylesheet = null;
            script = null;

            // define context menu state
            this.menuDocumentToolbar.Checked = true;
            this.menuDocumentScrollbar.Checked = true;
            this.menuDocumentWordwrap.Checked = true;

            // load the blank Html page to load the MsHtml object model
            BrowserCodeNavigate(BLANK_HTML_PAGE);

            // after load ensure document marked as editable
            this.ReadOnly = _readOnly;
        }