public void Initialize(ExtendedRichTextBox textBox, Func <string> getStatus) { _textBox = textBox; _getStatus = getStatus; _textBox.TextChanged += (sender, e) => { lblWordCount.Text = $"Words: {CompletionUtils.GetWordCount(_textBox.Text, false)}"; }; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UC_Dictionary)); ExtendedRichTextBox.CharStyle charStyle1 = new ExtendedRichTextBox.CharStyle(); ExtendedRichTextBox.ParaLineSpacing paraLineSpacing1 = new ExtendedRichTextBox.ParaLineSpacing(); ExtendedRichTextBox.ParaListStyle paraListStyle1 = new ExtendedRichTextBox.ParaListStyle(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.txtKeyword = new System.Windows.Forms.TextBox(); this.cbxDictionary = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.lblKeyWord = new System.Windows.Forms.Label(); this.lvwDE = new System.Windows.Forms.ListView(); this.clmKeyword = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.cmsRightMouse = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnuCopy = new System.Windows.Forms.ToolStripMenuItem(); this.mnuCut = new System.Windows.Forms.ToolStripMenuItem(); this.mnuPaste = new System.Windows.Forms.ToolStripMenuItem(); this.mnuConvert = new System.Windows.Forms.ToolStripMenuItem(); this.btnNew = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button(); this.btnDelete = new System.Windows.Forms.Button(); this.btnEdit = new System.Windows.Forms.Button(); this.pnlShow = new System.Windows.Forms.Panel(); this.rtxShow = new ExtendedRichTextBox(); this.tlsTool = new System.Windows.Forms.ToolStrip(); this.btnBold = new System.Windows.Forms.ToolStripButton(); this.btnItalic = new System.Windows.Forms.ToolStripButton(); this.btnUnderline = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.btnAlignLeft = new System.Windows.Forms.ToolStripButton(); this.btnAlignCenter = new System.Windows.Forms.ToolStripButton(); this.btnAlignRight = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.cboSize = new System.Windows.Forms.ToolStripComboBox(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.btnUndo = new System.Windows.Forms.ToolStripButton(); this.btnRedo = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.btnAddPicture = new System.Windows.Forms.ToolStripButton(); this.btnColor = new System.Windows.Forms.ToolStripButton(); this.btnHighLightColor = new System.Windows.Forms.ToolStripButton(); this.groupBox1.SuspendLayout(); this.cmsRightMouse.SuspendLayout(); this.pnlShow.SuspendLayout(); this.tlsTool.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.BackColor = System.Drawing.Color.Transparent; this.groupBox1.Controls.Add(this.txtKeyword); this.groupBox1.Controls.Add(this.cbxDictionary); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.lblKeyWord); this.groupBox1.Controls.Add(this.lvwDE); this.groupBox1.Location = new System.Drawing.Point(3, -2); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(251, 475); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; // // txtKeyword // this.txtKeyword.Location = new System.Drawing.Point(76, 53); this.txtKeyword.Name = "txtKeyword"; this.txtKeyword.Size = new System.Drawing.Size(155, 20); this.txtKeyword.TabIndex = 1; this.txtKeyword.TextChanged += new System.EventHandler(this.txtKeyWord_TextChanged); // // cbxDictionary // this.cbxDictionary.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxDictionary.FormattingEnabled = true; this.cbxDictionary.Items.AddRange(new object[] { "Afrikaans", "Albanian", "Arabic", "Armenian", "Azerbaijani", "Basque", "Belarusian", "Bengali", "Bosnian", "Bulgarian", "Catalan", "Cebuano", "Chinese", "Croatian", "Czech", "Danish", "Dutch", "English", "Esperanto", "Estonian", "Filipino", "Finnish", "French", "Galician", "Georgian", "German", "Greek", "Gujarati", "Haitian Creole", "Hausa", "Hebrew", "Hindi", "Hmong", "Hungarian", "Icelandic", "Igbo", "Indonesian", "Irish", "Italian", "Japanese", "Javanese", "Kannada", "Khmer", "Korean", "Lao", "Latin", "Latvian", "Lithuanian", "Macedonian", "Malay", "Maltese", "Maori", "Marathi", "Mongolian", "Nepali", "Norwegian", "Persian", "Polish", "Portuguese", "Punjabi", "Romanian", "Russian", "Serbian", "Slovak", "Slovenian", "Somali", "Spanish", "Swahili", "Swedish", "Tamil", "Telugu", "Thai", "Turkish", "Ukrainian", "Urdu", "Vietnamese", "Welsh", "Yiddish", "Yoruba", "Zulu"}); this.cbxDictionary.Location = new System.Drawing.Point(76, 16); this.cbxDictionary.Name = "cbxDictionary"; this.cbxDictionary.Size = new System.Drawing.Size(155, 21); this.cbxDictionary.TabIndex = 0; this.cbxDictionary.SelectedIndexChanged += new System.EventHandler(this.cbxDictionary_SelectedIndexChanged); // // label1 // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(6, 85); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(107, 13); this.label1.TabIndex = 6; this.label1.Text = "Dictionary Entries"; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.label2.Location = new System.Drawing.Point(6, 19); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(64, 13); this.label2.TabIndex = 0; this.label2.Text = "Dictionary"; // // lblKeyWord // this.lblKeyWord.AutoSize = true; this.lblKeyWord.BackColor = System.Drawing.Color.Transparent; this.lblKeyWord.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblKeyWord.Location = new System.Drawing.Point(6, 53); this.lblKeyWord.Name = "lblKeyWord"; this.lblKeyWord.Size = new System.Drawing.Size(55, 13); this.lblKeyWord.TabIndex = 4; this.lblKeyWord.Text = "Keyword"; // // lvwDE // this.lvwDE.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.clmKeyword}); this.lvwDE.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.lvwDE.FullRowSelect = true; this.lvwDE.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.lvwDE.Location = new System.Drawing.Point(6, 101); this.lvwDE.MultiSelect = false; this.lvwDE.Name = "lvwDE"; this.lvwDE.Size = new System.Drawing.Size(240, 374); this.lvwDE.TabIndex = 7; this.lvwDE.UseCompatibleStateImageBehavior = false; this.lvwDE.View = System.Windows.Forms.View.Details; this.lvwDE.SelectedIndexChanged += new System.EventHandler(this.lvwDE_SelectedIndexChanged); this.lvwDE.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvwDE_MouseClick); // // clmKeyword // this.clmKeyword.Text = ""; this.clmKeyword.Width = 232; // // cmsRightMouse // this.cmsRightMouse.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuCopy, this.mnuCut, this.mnuPaste, this.mnuConvert}); this.cmsRightMouse.Name = "cmsRightMouse"; this.cmsRightMouse.Size = new System.Drawing.Size(178, 92); // // mnuCopy // this.mnuCopy.Image = ((System.Drawing.Image)(resources.GetObject("mnuCopy.Image"))); this.mnuCopy.Name = "mnuCopy"; this.mnuCopy.Size = new System.Drawing.Size(177, 22); this.mnuCopy.Text = "Copy"; this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click); // // mnuCut // this.mnuCut.Image = ((System.Drawing.Image)(resources.GetObject("mnuCut.Image"))); this.mnuCut.Name = "mnuCut"; this.mnuCut.Size = new System.Drawing.Size(177, 22); this.mnuCut.Text = "Cut"; this.mnuCut.Click += new System.EventHandler(this.mnuCut_Click); // // mnuPaste // this.mnuPaste.Image = ((System.Drawing.Image)(resources.GetObject("mnuPaste.Image"))); this.mnuPaste.Name = "mnuPaste"; this.mnuPaste.Size = new System.Drawing.Size(177, 22); this.mnuPaste.Text = "Paste"; this.mnuPaste.Click += new System.EventHandler(this.mnuPaste_Click); // // mnuConvert // this.mnuConvert.Name = "mnuConvert"; this.mnuConvert.Size = new System.Drawing.Size(177, 22); this.mnuConvert.Text = "Convert to Rtf code"; this.mnuConvert.Click += new System.EventHandler(this.mnuConvert_Click); // // btnNew // this.btnNew.BackColor = System.Drawing.SystemColors.Control; this.btnNew.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnNew.BackgroundImage"))); this.btnNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnNew.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnNew.Image = ((System.Drawing.Image)(resources.GetObject("btnNew.Image"))); this.btnNew.ImageAlign = System.Drawing.ContentAlignment.TopCenter; this.btnNew.Location = new System.Drawing.Point(260, 3); this.btnNew.Name = "btnNew"; this.btnNew.Size = new System.Drawing.Size(50, 50); this.btnNew.TabIndex = 3; this.btnNew.Text = "New"; this.btnNew.TextAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnNew.UseVisualStyleBackColor = false; this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // btnSave // this.btnSave.BackColor = System.Drawing.SystemColors.Control; this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage"))); this.btnSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image"))); this.btnSave.ImageAlign = System.Drawing.ContentAlignment.TopCenter; this.btnSave.Location = new System.Drawing.Point(260, 171); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(50, 50); this.btnSave.TabIndex = 6; this.btnSave.Text = "Save"; this.btnSave.TextAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnSave.UseVisualStyleBackColor = false; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // btnDelete // this.btnDelete.BackColor = System.Drawing.SystemColors.Control; this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage"))); this.btnDelete.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image"))); this.btnDelete.ImageAlign = System.Drawing.ContentAlignment.TopCenter; this.btnDelete.Location = new System.Drawing.Point(260, 115); this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new System.Drawing.Size(50, 50); this.btnDelete.TabIndex = 5; this.btnDelete.Text = "Delete"; this.btnDelete.TextAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnDelete.UseVisualStyleBackColor = false; this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); // // btnEdit // this.btnEdit.BackColor = System.Drawing.SystemColors.Control; this.btnEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnEdit.BackgroundImage"))); this.btnEdit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image"))); this.btnEdit.ImageAlign = System.Drawing.ContentAlignment.TopCenter; this.btnEdit.Location = new System.Drawing.Point(260, 59); this.btnEdit.Name = "btnEdit"; this.btnEdit.Size = new System.Drawing.Size(50, 50); this.btnEdit.TabIndex = 4; this.btnEdit.Text = "Edit"; this.btnEdit.TextAlign = System.Drawing.ContentAlignment.BottomCenter; this.btnEdit.UseVisualStyleBackColor = false; this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); // // pnlShow // this.pnlShow.Controls.Add(this.rtxShow); this.pnlShow.Controls.Add(this.tlsTool); this.pnlShow.Location = new System.Drawing.Point(316, 3); this.pnlShow.Name = "pnlShow"; this.pnlShow.Size = new System.Drawing.Size(611, 470); this.pnlShow.TabIndex = 7; // // rtxShow // this.rtxShow.BackColor = System.Drawing.Color.Honeydew; this.rtxShow.ContextMenuStrip = this.cmsRightMouse; this.rtxShow.Dock = System.Windows.Forms.DockStyle.Fill; this.rtxShow.Location = new System.Drawing.Point(0, 25); this.rtxShow.Name = "rtxShow"; charStyle1.Bold = false; charStyle1.Italic = false; charStyle1.Link = false; charStyle1.Strikeout = false; charStyle1.Underline = false; this.rtxShow.SelectionCharStyle = charStyle1; this.rtxShow.SelectionFont2 = new System.Drawing.Font("Microsoft Sans Serif", 2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Inch); paraLineSpacing1.ExactSpacing = 0; paraLineSpacing1.SpacingStyle = ExtendedRichTextBox.ParaLineSpacing.LineSpacingStyle.Unknown; this.rtxShow.SelectionLineSpacing = paraLineSpacing1; paraListStyle1.BulletCharCode = ((short)(0)); paraListStyle1.NumberingStart = ((short)(0)); paraListStyle1.Style = ExtendedRichTextBox.ParaListStyle.ListStyle.NumberAndParenthesis; paraListStyle1.Type = ExtendedRichTextBox.ParaListStyle.ListType.None; this.rtxShow.SelectionListType = paraListStyle1; this.rtxShow.SelectionOffsetType = ExtendedRichTextBox.OffsetType.None; this.rtxShow.SelectionSpaceAfter = 0; this.rtxShow.SelectionSpaceBefore = 0; this.rtxShow.Size = new System.Drawing.Size(611, 445); this.rtxShow.TabIndex = 2; this.rtxShow.Text = ""; // // tlsTool // this.tlsTool.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.tlsTool.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btnBold, this.btnItalic, this.btnUnderline, this.toolStripSeparator1, this.btnAlignLeft, this.btnAlignCenter, this.btnAlignRight, this.toolStripSeparator2, this.cboSize, this.toolStripSeparator4, this.btnUndo, this.btnRedo, this.toolStripSeparator3, this.btnAddPicture, this.btnColor, this.btnHighLightColor}); this.tlsTool.Location = new System.Drawing.Point(0, 0); this.tlsTool.Name = "tlsTool"; this.tlsTool.Size = new System.Drawing.Size(611, 25); this.tlsTool.TabIndex = 4; this.tlsTool.Text = "toolStrip1"; // // btnBold // this.btnBold.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnBold.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnBold.Image = ((System.Drawing.Image)(resources.GetObject("btnBold.Image"))); this.btnBold.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnBold.Name = "btnBold"; this.btnBold.Size = new System.Drawing.Size(23, 22); this.btnBold.Text = "B"; this.btnBold.Click += new System.EventHandler(this.btnBold_Click); // // btnItalic // this.btnItalic.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnItalic.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnItalic.Image = ((System.Drawing.Image)(resources.GetObject("btnItalic.Image"))); this.btnItalic.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnItalic.Name = "btnItalic"; this.btnItalic.Size = new System.Drawing.Size(23, 22); this.btnItalic.Text = "I"; this.btnItalic.Click += new System.EventHandler(this.btnItalic_Click); // // btnUnderline // this.btnUnderline.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnUnderline.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnUnderline.Image = ((System.Drawing.Image)(resources.GetObject("btnUnderline.Image"))); this.btnUnderline.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnUnderline.Name = "btnUnderline"; this.btnUnderline.Size = new System.Drawing.Size(23, 22); this.btnUnderline.Text = "U"; this.btnUnderline.Click += new System.EventHandler(this.btnUnderline_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // btnAlignLeft // this.btnAlignLeft.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignLeft.Image = ((System.Drawing.Image)(resources.GetObject("btnAlignLeft.Image"))); this.btnAlignLeft.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignLeft.Name = "btnAlignLeft"; this.btnAlignLeft.Size = new System.Drawing.Size(23, 22); this.btnAlignLeft.Text = "toolStripButton1"; this.btnAlignLeft.Click += new System.EventHandler(this.btnLeftAlign_Click); // // btnAlignCenter // this.btnAlignCenter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignCenter.Image = ((System.Drawing.Image)(resources.GetObject("btnAlignCenter.Image"))); this.btnAlignCenter.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignCenter.Name = "btnAlignCenter"; this.btnAlignCenter.Size = new System.Drawing.Size(23, 22); this.btnAlignCenter.Text = "toolStripButton1"; this.btnAlignCenter.Click += new System.EventHandler(this.btnCenterAlign_Click); // // btnAlignRight // this.btnAlignRight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignRight.Image = ((System.Drawing.Image)(resources.GetObject("btnAlignRight.Image"))); this.btnAlignRight.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignRight.Name = "btnAlignRight"; this.btnAlignRight.Size = new System.Drawing.Size(23, 22); this.btnAlignRight.Text = "toolStripButton1"; this.btnAlignRight.Click += new System.EventHandler(this.btnRightAlign_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // cboSize // this.cboSize.AutoSize = false; this.cboSize.Items.AddRange(new object[] { "8", "9", "10", "11", "12", "14", "16", "18", "20", "22", "24", "26", "28", "36", "48", "72"}); this.cboSize.Name = "cboSize"; this.cboSize.Size = new System.Drawing.Size(35, 23); this.cboSize.Text = "8"; this.cboSize.SelectedIndexChanged += new System.EventHandler(this.cboSize_SelectedIndexChanged); this.cboSize.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboSize_KeyDown); this.cboSize.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cboSize_KeyUp); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); // // btnUndo // this.btnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnUndo.Image = ((System.Drawing.Image)(resources.GetObject("btnUndo.Image"))); this.btnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnUndo.Name = "btnUndo"; this.btnUndo.Size = new System.Drawing.Size(23, 22); this.btnUndo.Text = "toolStripButton1"; this.btnUndo.Click += new System.EventHandler(this.btnUndo_Click); // // btnRedo // this.btnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnRedo.Image = ((System.Drawing.Image)(resources.GetObject("btnRedo.Image"))); this.btnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnRedo.Name = "btnRedo"; this.btnRedo.Size = new System.Drawing.Size(23, 22); this.btnRedo.Text = "toolStripButton1"; this.btnRedo.Click += new System.EventHandler(this.btnRedo_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); // // btnAddPicture // this.btnAddPicture.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAddPicture.Image = ((System.Drawing.Image)(resources.GetObject("btnAddPicture.Image"))); this.btnAddPicture.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAddPicture.Name = "btnAddPicture"; this.btnAddPicture.Size = new System.Drawing.Size(23, 22); this.btnAddPicture.Text = "toolStripButton1"; this.btnAddPicture.Click += new System.EventHandler(this.btnAddPicture_Click); // // btnColor // this.btnColor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnColor.Image = ((System.Drawing.Image)(resources.GetObject("btnColor.Image"))); this.btnColor.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnColor.Name = "btnColor"; this.btnColor.Size = new System.Drawing.Size(23, 22); this.btnColor.Text = "toolStripButton1"; this.btnColor.Click += new System.EventHandler(this.btnColor_Click); // // btnHighLightColor // this.btnHighLightColor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnHighLightColor.Image = global::Reminiscent.Properties.Resources.mnuHighlightColor; this.btnHighLightColor.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnHighLightColor.Name = "btnHighLightColor"; this.btnHighLightColor.Size = new System.Drawing.Size(23, 22); this.btnHighLightColor.Text = "toolStripButton1"; this.btnHighLightColor.Click += new System.EventHandler(this.btnHighLightColor_Click); // // UC_Dictionary // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Transparent; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.Controls.Add(this.pnlShow); this.Controls.Add(this.btnSave); this.Controls.Add(this.btnDelete); this.Controls.Add(this.btnEdit); this.Controls.Add(this.btnNew); this.Controls.Add(this.groupBox1); this.Name = "UC_Dictionary"; this.Size = new System.Drawing.Size(930, 473); this.Load += new System.EventHandler(this.UC_Dictionary_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.cmsRightMouse.ResumeLayout(false); this.pnlShow.ResumeLayout(false); this.pnlShow.PerformLayout(); this.tlsTool.ResumeLayout(false); this.tlsTool.PerformLayout(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ucRichText)); ExtendedRichTextBox.CharStyle charStyle1 = new ExtendedRichTextBox.CharStyle(); ExtendedRichTextBox.ParaLineSpacing paraLineSpacing1 = new ExtendedRichTextBox.ParaLineSpacing(); ExtendedRichTextBox.ParaListStyle paraListStyle1 = new ExtendedRichTextBox.ParaListStyle(); this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); this.cmsRightMouse = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnuCopy = new System.Windows.Forms.ToolStripMenuItem(); this.mnuCut = new System.Windows.Forms.ToolStripMenuItem(); this.mnuPaste = new System.Windows.Forms.ToolStripMenuItem(); this.mnuConvert = new System.Windows.Forms.ToolStripMenuItem(); this.tlsTool = new System.Windows.Forms.ToolStrip(); this.btnBold = new System.Windows.Forms.ToolStripButton(); this.btnItalic = new System.Windows.Forms.ToolStripButton(); this.btnUnderline = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.btnAlignLeft = new System.Windows.Forms.ToolStripButton(); this.btnAlignCenter = new System.Windows.Forms.ToolStripButton(); this.btnAlignRight = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.btnUndo = new System.Windows.Forms.ToolStripButton(); this.btnRedo = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.btnAddPicture = new System.Windows.Forms.ToolStripButton(); this.btnColor = new System.Windows.Forms.ToolStripButton(); this.btnHighLightColor = new System.Windows.Forms.ToolStripButton(); this.rtxShow = new ExtendedRichTextBox(); this.tlpMain.SuspendLayout(); this.cmsRightMouse.SuspendLayout(); this.tlsTool.SuspendLayout(); this.SuspendLayout(); // // tlpMain // this.tlpMain.ColumnCount = 1; this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tlpMain.Controls.Add(this.rtxShow, 0, 1); this.tlpMain.Controls.Add(this.tlsTool, 0, 0); this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMain.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.tlpMain.Location = new System.Drawing.Point(0, 0); this.tlpMain.Name = "tlpMain"; this.tlpMain.RowCount = 2; this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tlpMain.Size = new System.Drawing.Size(620, 430); this.tlpMain.TabIndex = 1; // // cmsRightMouse // this.cmsRightMouse.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuCopy, this.mnuCut, this.mnuPaste, this.mnuConvert}); this.cmsRightMouse.Name = "cmsRightMouse"; this.cmsRightMouse.Size = new System.Drawing.Size(178, 92); // // mnuCopy // this.mnuCopy.Image = global::Reminiscent.Properties.Resources.btnCopy; this.mnuCopy.Name = "mnuCopy"; this.mnuCopy.Size = new System.Drawing.Size(177, 22); this.mnuCopy.Text = "Copy"; this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click); // // mnuCut // this.mnuCut.Image = global::Reminiscent.Properties.Resources.btnCut; this.mnuCut.Name = "mnuCut"; this.mnuCut.Size = new System.Drawing.Size(177, 22); this.mnuCut.Text = "Cut"; this.mnuCut.Click += new System.EventHandler(this.mnuCut_Click); // // mnuPaste // this.mnuPaste.Image = global::Reminiscent.Properties.Resources.btnPaste; this.mnuPaste.Name = "mnuPaste"; this.mnuPaste.Size = new System.Drawing.Size(177, 22); this.mnuPaste.Text = "Paste"; this.mnuPaste.Click += new System.EventHandler(this.mnuPaste_Click); // // mnuConvert // this.mnuConvert.Name = "mnuConvert"; this.mnuConvert.Size = new System.Drawing.Size(177, 22); this.mnuConvert.Text = "Convert to Rtf code"; this.mnuConvert.Click += new System.EventHandler(this.mnuConvert_Click); // // tlsTool // this.tlsTool.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.tlsTool.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btnBold, this.btnItalic, this.btnUnderline, this.toolStripSeparator1, this.btnAlignLeft, this.btnAlignCenter, this.btnAlignRight, this.toolStripSeparator2, this.btnUndo, this.btnRedo, this.toolStripSeparator3, this.btnAddPicture, this.btnColor, this.btnHighLightColor}); this.tlsTool.Location = new System.Drawing.Point(0, 0); this.tlsTool.Name = "tlsTool"; this.tlsTool.Size = new System.Drawing.Size(620, 25); this.tlsTool.TabIndex = 1; this.tlsTool.Text = "toolStrip1"; // // btnBold // this.btnBold.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnBold.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnBold.Image = ((System.Drawing.Image)(resources.GetObject("btnBold.Image"))); this.btnBold.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnBold.Name = "btnBold"; this.btnBold.Size = new System.Drawing.Size(23, 22); this.btnBold.Text = "B"; this.btnBold.Click += new System.EventHandler(this.btnBold_Click); // // btnItalic // this.btnItalic.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnItalic.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnItalic.Image = ((System.Drawing.Image)(resources.GetObject("btnItalic.Image"))); this.btnItalic.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnItalic.Name = "btnItalic"; this.btnItalic.Size = new System.Drawing.Size(23, 22); this.btnItalic.Text = "I"; this.btnItalic.Click += new System.EventHandler(this.btnItalic_Click); // // btnUnderline // this.btnUnderline.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btnUnderline.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.btnUnderline.Image = ((System.Drawing.Image)(resources.GetObject("btnUnderline.Image"))); this.btnUnderline.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnUnderline.Name = "btnUnderline"; this.btnUnderline.Size = new System.Drawing.Size(23, 22); this.btnUnderline.Text = "U"; this.btnUnderline.Click += new System.EventHandler(this.btnUnderline_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // btnAlignLeft // this.btnAlignLeft.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignLeft.Image = global::Reminiscent.Properties.Resources.btnAlignLeft; this.btnAlignLeft.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignLeft.Name = "btnAlignLeft"; this.btnAlignLeft.Size = new System.Drawing.Size(23, 22); this.btnAlignLeft.Text = "toolStripButton1"; this.btnAlignLeft.Click += new System.EventHandler(this.btnLeftAlign_Click); // // btnAlignCenter // this.btnAlignCenter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignCenter.Image = global::Reminiscent.Properties.Resources.btnAlignCenter; this.btnAlignCenter.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignCenter.Name = "btnAlignCenter"; this.btnAlignCenter.Size = new System.Drawing.Size(23, 22); this.btnAlignCenter.Text = "toolStripButton1"; this.btnAlignCenter.Click += new System.EventHandler(this.btnCenterAlign_Click); // // btnAlignRight // this.btnAlignRight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAlignRight.Image = global::Reminiscent.Properties.Resources.btnAlignRight; this.btnAlignRight.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAlignRight.Name = "btnAlignRight"; this.btnAlignRight.Size = new System.Drawing.Size(23, 22); this.btnAlignRight.Text = "toolStripButton1"; this.btnAlignRight.Click += new System.EventHandler(this.btnRightAlign_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // btnUndo // this.btnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnUndo.Name = "btnUndo"; this.btnUndo.Size = new System.Drawing.Size(23, 22); this.btnUndo.Text = "toolStripButton1"; this.btnUndo.Click += new System.EventHandler(this.btnUndo_Click); // // btnRedo // this.btnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnRedo.Name = "btnRedo"; this.btnRedo.Size = new System.Drawing.Size(23, 22); this.btnRedo.Text = "toolStripButton1"; this.btnRedo.Click += new System.EventHandler(this.btnRedo_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); // // btnAddPicture // this.btnAddPicture.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnAddPicture.Image = global::Reminiscent.Properties.Resources.mnuInsertPicture; this.btnAddPicture.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnAddPicture.Name = "btnAddPicture"; this.btnAddPicture.Size = new System.Drawing.Size(23, 22); this.btnAddPicture.Text = "toolStripButton1"; this.btnAddPicture.Click += new System.EventHandler(this.btnAddPicture_Click); // // btnColor // this.btnColor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnColor.Image = global::Reminiscent.Properties.Resources.mnuTextColor; this.btnColor.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnColor.Name = "btnColor"; this.btnColor.Size = new System.Drawing.Size(23, 22); this.btnColor.Text = "toolStripButton1"; this.btnColor.Click += new System.EventHandler(this.btnColor_Click); // // btnHighLightColor // this.btnHighLightColor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnHighLightColor.Image = global::Reminiscent.Properties.Resources.mnuHighlightColor; this.btnHighLightColor.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnHighLightColor.Name = "btnHighLightColor"; this.btnHighLightColor.Size = new System.Drawing.Size(23, 22); this.btnHighLightColor.Text = "toolStripButton1"; this.btnHighLightColor.Click += new System.EventHandler(this.btnHighLightColor_Click); // // rtxShow // this.rtxShow.BackColor = System.Drawing.Color.Honeydew; this.rtxShow.ContextMenuStrip = this.cmsRightMouse; this.rtxShow.Dock = System.Windows.Forms.DockStyle.Fill; this.rtxShow.Location = new System.Drawing.Point(3, 30); this.rtxShow.Name = "rtxShow"; charStyle1.Bold = false; charStyle1.Italic = false; charStyle1.Link = false; charStyle1.Strikeout = false; charStyle1.Underline = false; this.rtxShow.SelectionCharStyle = charStyle1; this.rtxShow.SelectionFont2 = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Inch); paraLineSpacing1.ExactSpacing = 0; paraLineSpacing1.SpacingStyle = ExtendedRichTextBox.ParaLineSpacing.LineSpacingStyle.Unknown; this.rtxShow.SelectionLineSpacing = paraLineSpacing1; paraListStyle1.BulletCharCode = ((short)(0)); paraListStyle1.NumberingStart = ((short)(0)); paraListStyle1.Style = ExtendedRichTextBox.ParaListStyle.ListStyle.NumberAndParenthesis; paraListStyle1.Type = ExtendedRichTextBox.ParaListStyle.ListType.None; this.rtxShow.SelectionListType = paraListStyle1; this.rtxShow.SelectionOffsetType = ExtendedRichTextBox.OffsetType.None; this.rtxShow.SelectionSpaceAfter = 0; this.rtxShow.SelectionSpaceBefore = 0; this.rtxShow.Size = new System.Drawing.Size(614, 397); this.rtxShow.TabIndex = 2; this.rtxShow.Text = ""; // // ucRichText // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ContextMenuStrip = this.cmsRightMouse; this.Controls.Add(this.tlpMain); this.Name = "ucRichText"; this.Size = new System.Drawing.Size(620, 430); this.tlpMain.ResumeLayout(false); this.tlpMain.PerformLayout(); this.cmsRightMouse.ResumeLayout(false); this.tlsTool.ResumeLayout(false); this.tlsTool.PerformLayout(); this.ResumeLayout(false); }
public RichEditOle(ExtendedRichTextBox richEdit) { this._richEdit = richEdit; }
public void Initialize(ExtendedRichTextBox textBox, List <Panel> indentPanels, Action toggleDarkMode) { _indentPanels = indentPanels; _textBox = textBox; _textBox.SelectionChanged += TextBox_SelectionChanged; cbxFonts.Visible = false; cbxFonts.ComboBox.DataSource = FontFamily.Families.ToList(); cbxFonts.ComboBox.DisplayMember = "Name"; cbxFonts.ComboBox.DrawMode = DrawMode.OwnerDrawVariable; cbxFonts.ComboBox.DrawItem += (sender, e) => { var comboBox = (ComboBox)sender; var fontFamily = (FontFamily)comboBox.Items[e.Index]; var font = new Font(fontFamily, comboBox.Font.SizeInPoints); e.DrawBackground(); e.Graphics.DrawString(font.Name, font, Brushes.Black, e.Bounds.X, e.Bounds.Y); }; btnTextStyle.DropDownItems.Cast <ToolStripItem>().ForEach(item => { item.Click += (sender, e) => { var castSender = (TextCustomizationItem)sender; _textBox.SelectionFont = new Font(_textBox.SelectionFont.Name, castSender.TextSize, _textBox.SelectionFont.Style); btnTextStyle.Text = castSender.Text; btnTextStyle.Image = castSender.Image; }; }); _alignmentItems = toolStrip.Items.Cast <ToolStripItem>().OfType <TextCustomizationButton>() .Where(i => i.TextAlignment != ExtendedRichTextBox.RichTextAlign.Unknown); _fontStyleItems = toolStrip.Items.Cast <ToolStripItem>().OfType <TextCustomizationButton>() .Where(i => i.FontStyle != null); _alignmentItems.ForEach(item => { item.Click += (sender, e) => { var button = (TextCustomizationButton)sender; _textBox.SelectionAlignment = button.TextAlignment; _alignmentItems.ForEach(j => j.Checked = false); button.Checked = true; }; }); _fontStyleItems.ForEach(item => { item.Click += (sender, e) => { var button = (TextCustomizationButton)sender; _textBox.SelectionFont = new Font(_textBox.SelectionFont, _textBox.SelectionFont.Style | (button.FontStyle ?? FontStyle.Regular)); button.Checked = true; }; }); btnDarkMode.Click += (sender, e) => toggleDarkMode(); _initialized = true; }