From 8b06c16a8066e6a06dca073411afd35035877135 Mon Sep 17 00:00:00 2001 From: Ahmet Sait Date: Fri, 12 Jul 2024 10:42:57 +0300 Subject: [PATCH] [TestApp] Use `FindText()` --- Scintilla.NET.TestApp/FormMain.Designer.cs | 372 +++++++++++---------- Scintilla.NET.TestApp/FormMain.cs | 44 +++ 2 files changed, 240 insertions(+), 176 deletions(-) diff --git a/Scintilla.NET.TestApp/FormMain.Designer.cs b/Scintilla.NET.TestApp/FormMain.Designer.cs index 906d137..d02acc0 100644 --- a/Scintilla.NET.TestApp/FormMain.Designer.cs +++ b/Scintilla.NET.TestApp/FormMain.Designer.cs @@ -28,193 +28,211 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.scintilla = new ScintillaNET.Scintilla(); - this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel_Version = new System.Windows.Forms.ToolStripStatusLabel(); - this.statusStrip = new System.Windows.Forms.StatusStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.describeKeywordSetsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.lexersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.statusStrip.SuspendLayout(); - this.menuStrip.SuspendLayout(); - this.SuspendLayout(); - // - // openFileDialog - // - this.openFileDialog.Filter = "All Files|*.*"; - // - // scintilla - // - this.scintilla._ScintillaManagedDragDrop = true; - this.scintilla.BorderStyle = ScintillaNET.BorderStyle.Fixed3DVisualStyles; - this.scintilla.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(255))))); - this.scintilla.ChangeHistory = ((ScintillaNET.ChangeHistory)((ScintillaNET.ChangeHistory.Enabled | ScintillaNET.ChangeHistory.Markers))); - this.scintilla.Dock = System.Windows.Forms.DockStyle.Fill; - this.scintilla.FoldLineStripColor = System.Drawing.Color.Gray; - this.scintilla.Font = new System.Drawing.Font("Consolas", 10.2F); - this.scintilla.LexerName = null; - this.scintilla.Location = new System.Drawing.Point(0, 28); - this.scintilla.Name = "scintilla"; - this.scintilla.ScrollWidth = 1; - this.scintilla.Size = new System.Drawing.Size(914, 426); - this.scintilla.TabIndex = 2; - this.scintilla.SavePointLeft += new System.EventHandler(this.scintilla_SavePointLeft); - this.scintilla.SavePointReached += new System.EventHandler(this.scintilla_SavePointReached); - this.scintilla.TextChanged += new System.EventHandler(this.scintilla_TextChanged); - this.scintilla.KeyDown += new System.Windows.Forms.KeyEventHandler(this.scintilla_KeyDown); - // - // toolStripStatusLabel - // - this.toolStripStatusLabel.Name = "toolStripStatusLabel"; - this.toolStripStatusLabel.Size = new System.Drawing.Size(13, 20); - this.toolStripStatusLabel.Text = " "; - // - // toolStripStatusLabel_Version - // - this.toolStripStatusLabel_Version.Name = "toolStripStatusLabel_Version"; - this.toolStripStatusLabel_Version.Size = new System.Drawing.Size(886, 20); - this.toolStripStatusLabel_Version.Spring = true; - this.toolStripStatusLabel_Version.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // statusStrip - // - this.statusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.scintilla = new ScintillaNET.Scintilla(); + this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel_Version = new System.Windows.Forms.ToolStripStatusLabel(); + this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.describeKeywordSetsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.lexersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripTextBox_Find = new System.Windows.Forms.ToolStripTextBox(); + this.toolStripMenuItem_Find = new System.Windows.Forms.ToolStripMenuItem(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.statusStrip.SuspendLayout(); + this.menuStrip.SuspendLayout(); + this.SuspendLayout(); + // + // openFileDialog + // + this.openFileDialog.Filter = "All Files|*.*"; + // + // scintilla + // + this.scintilla._ScintillaManagedDragDrop = true; + this.scintilla.BorderStyle = ScintillaNET.BorderStyle.Fixed3DVisualStyles; + this.scintilla.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(255))))); + this.scintilla.ChangeHistory = ((ScintillaNET.ChangeHistory)((ScintillaNET.ChangeHistory.Enabled | ScintillaNET.ChangeHistory.Markers))); + this.scintilla.Dock = System.Windows.Forms.DockStyle.Fill; + this.scintilla.FoldLineStripColor = System.Drawing.Color.Gray; + this.scintilla.Font = new System.Drawing.Font("Consolas", 10.2F); + this.scintilla.LexerName = null; + this.scintilla.Location = new System.Drawing.Point(0, 27); + this.scintilla.Margin = new System.Windows.Forms.Padding(2); + this.scintilla.Name = "scintilla"; + this.scintilla.Size = new System.Drawing.Size(731, 335); + this.scintilla.TabIndex = 2; + this.scintilla.SavePointLeft += new System.EventHandler(this.scintilla_SavePointLeft); + this.scintilla.SavePointReached += new System.EventHandler(this.scintilla_SavePointReached); + this.scintilla.TextChanged += new System.EventHandler(this.scintilla_TextChanged); + // + // toolStripStatusLabel + // + this.toolStripStatusLabel.Name = "toolStripStatusLabel"; + this.toolStripStatusLabel.Size = new System.Drawing.Size(10, 17); + this.toolStripStatusLabel.Text = " "; + // + // toolStripStatusLabel_Version + // + this.toolStripStatusLabel_Version.Name = "toolStripStatusLabel_Version"; + this.toolStripStatusLabel_Version.Size = new System.Drawing.Size(709, 17); + this.toolStripStatusLabel_Version.Spring = true; + this.toolStripStatusLabel_Version.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // statusStrip + // + this.statusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); + this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel, this.toolStripStatusLabel_Version}); - this.statusStrip.Location = new System.Drawing.Point(0, 454); - this.statusStrip.Name = "statusStrip"; - this.statusStrip.Size = new System.Drawing.Size(914, 26); - this.statusStrip.SizingGrip = false; - this.statusStrip.TabIndex = 3; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.statusStrip.Location = new System.Drawing.Point(0, 362); + this.statusStrip.Name = "statusStrip"; + this.statusStrip.Padding = new System.Windows.Forms.Padding(1, 0, 11, 0); + this.statusStrip.Size = new System.Drawing.Size(731, 22); + this.statusStrip.SizingGrip = false; + this.statusStrip.TabIndex = 3; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openToolStripMenuItem, this.toolStripSeparator, this.saveToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); - this.fileToolStripMenuItem.Text = "&File"; - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); - this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(181, 26); - this.openToolStripMenuItem.Text = "&Open"; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // toolStripSeparator - // - this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(178, 6); - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); - this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(181, 26); - this.saveToolStripMenuItem.Text = "&Save"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // toolsToolStripMenuItem - // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 23); + this.fileToolStripMenuItem.Text = "&File"; + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); + this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.openToolStripMenuItem.Text = "&Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // toolStripSeparator + // + this.toolStripSeparator.Name = "toolStripSeparator"; + this.toolStripSeparator.Size = new System.Drawing.Size(143, 6); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); + this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.saveToolStripMenuItem.Text = "&Save"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.describeKeywordSetsToolStripMenuItem, this.optionsToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24); - this.toolsToolStripMenuItem.Text = "&Tools"; - // - // describeKeywordSetsToolStripMenuItem - // - this.describeKeywordSetsToolStripMenuItem.Name = "describeKeywordSetsToolStripMenuItem"; - this.describeKeywordSetsToolStripMenuItem.Size = new System.Drawing.Size(243, 26); - this.describeKeywordSetsToolStripMenuItem.Text = "Describe &Keyword Sets"; - this.describeKeywordSetsToolStripMenuItem.Click += new System.EventHandler(this.describeKeywordSetsToolStripMenuItem_Click); - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.Enabled = false; - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(243, 26); - this.optionsToolStripMenuItem.Text = "&Options"; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 23); + this.toolsToolStripMenuItem.Text = "&Tools"; + // + // describeKeywordSetsToolStripMenuItem + // + this.describeKeywordSetsToolStripMenuItem.Name = "describeKeywordSetsToolStripMenuItem"; + this.describeKeywordSetsToolStripMenuItem.Size = new System.Drawing.Size(192, 22); + this.describeKeywordSetsToolStripMenuItem.Text = "Describe &Keyword Sets"; + this.describeKeywordSetsToolStripMenuItem.Click += new System.EventHandler(this.describeKeywordSetsToolStripMenuItem_Click); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.Enabled = false; + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(192, 22); + this.optionsToolStripMenuItem.Text = "&Options"; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 24); - this.helpToolStripMenuItem.Text = "&Help"; - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Enabled = false; - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(142, 26); - this.aboutToolStripMenuItem.Text = "&About..."; - // - // menuStrip - // - this.menuStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 23); + this.helpToolStripMenuItem.Text = "&Help"; + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Enabled = false; + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.aboutToolStripMenuItem.Text = "&About..."; + // + // menuStrip + // + this.menuStrip.ImageScalingSize = new System.Drawing.Size(20, 20); + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.lexersToolStripMenuItem, this.toolsToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip.Location = new System.Drawing.Point(0, 0); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(914, 28); - this.menuStrip.TabIndex = 1; - // - // lexersToolStripMenuItem - // - this.lexersToolStripMenuItem.Name = "lexersToolStripMenuItem"; - this.lexersToolStripMenuItem.Size = new System.Drawing.Size(64, 24); - this.lexersToolStripMenuItem.Text = "Lexers"; - // - // saveFileDialog - // - this.saveFileDialog.Filter = "All Files|*.*"; - // - // FormMain - // - this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(914, 480); - this.Controls.Add(this.scintilla); - this.Controls.Add(this.statusStrip); - this.Controls.Add(this.menuStrip); - this.MainMenuStrip = this.menuStrip; - this.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); - this.Name = "FormMain"; - this.Text = "Scintilla.NET Test App"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); - this.Shown += new System.EventHandler(this.FormMain_Shown); - this.statusStrip.ResumeLayout(false); - this.statusStrip.PerformLayout(); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.helpToolStripMenuItem, + this.toolStripTextBox_Find, + this.toolStripMenuItem_Find}); + this.menuStrip.Location = new System.Drawing.Point(0, 0); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2); + this.menuStrip.Size = new System.Drawing.Size(731, 27); + this.menuStrip.TabIndex = 1; + // + // lexersToolStripMenuItem + // + this.lexersToolStripMenuItem.Name = "lexersToolStripMenuItem"; + this.lexersToolStripMenuItem.Size = new System.Drawing.Size(52, 23); + this.lexersToolStripMenuItem.Text = "Lexers"; + // + // toolStripTextBox_Find + // + this.toolStripTextBox_Find.Name = "toolStripTextBox_Find"; + this.toolStripTextBox_Find.Size = new System.Drawing.Size(100, 23); + this.toolStripTextBox_Find.KeyDown += new System.Windows.Forms.KeyEventHandler(this.toolStripTextBox_Find_KeyDown); + // + // toolStripMenuItem_Find + // + this.toolStripMenuItem_Find.Name = "toolStripMenuItem_Find"; + this.toolStripMenuItem_Find.Size = new System.Drawing.Size(42, 23); + this.toolStripMenuItem_Find.Text = "Find"; + this.toolStripMenuItem_Find.Click += new System.EventHandler(this.toolStripMenuItem_Find_Click); + // + // saveFileDialog + // + this.saveFileDialog.Filter = "All Files|*.*"; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(731, 384); + this.Controls.Add(this.scintilla); + this.Controls.Add(this.statusStrip); + this.Controls.Add(this.menuStrip); + this.MainMenuStrip = this.menuStrip; + this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.Name = "FormMain"; + this.Text = "Scintilla.NET Test App"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); + this.Shown += new System.EventHandler(this.FormMain_Shown); + this.statusStrip.ResumeLayout(false); + this.statusStrip.PerformLayout(); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -236,6 +254,8 @@ private void InitializeComponent() private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.ToolStripMenuItem lexersToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem describeKeywordSetsToolStripMenuItem; + private System.Windows.Forms.ToolStripTextBox toolStripTextBox_Find; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_Find; } } diff --git a/Scintilla.NET.TestApp/FormMain.cs b/Scintilla.NET.TestApp/FormMain.cs index 3ffc68b..4dbc578 100644 --- a/Scintilla.NET.TestApp/FormMain.cs +++ b/Scintilla.NET.TestApp/FormMain.cs @@ -237,4 +237,48 @@ private void scintilla_SavePointReached(object sender, EventArgs e) { Text = BaseTitle; } + + private void toolStripMenuItem_Find_Click(object sender, EventArgs e) + { + Search(toolStripTextBox_Find.Text); + } + + private void Search(string text, bool reverse = false) + { + if (string.IsNullOrEmpty(text)) + return; + + int start = reverse ? scintilla.AnchorPosition : scintilla.CurrentPosition; + int end = reverse ? 0 : scintilla.TextLength; + int pos = scintilla.FindText(SearchFlags.None, text, start, end); + if (pos == -1) + { + start = reverse ? scintilla.TextLength : 0; + end = reverse ? scintilla.AnchorPosition - text.Length : scintilla.CurrentPosition + text.Length; + pos = scintilla.FindText(SearchFlags.None, text, start, end); + if (pos == -1) + { + toolStripStatusLabel.Text = $"\"{text}\" not found in document."; + return; + } + else + toolStripStatusLabel.Text = $"Search wrapped."; + } + else + toolStripStatusLabel.Text = ""; + + int caret = pos + text.Length, anchor = pos; + scintilla.SetSelection(caret, anchor); + scintilla.ScrollRange(anchor, caret); + } + + private void toolStripTextBox_Find_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter && (e.Modifiers & ~Keys.Shift) == 0) + { + Search(toolStripTextBox_Find.Text, e.Shift); + e.Handled = true; + e.SuppressKeyPress = true; + } + } }