Skip to content

Commit

Permalink
Disable caret selection from text visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Jul 20, 2023
1 parent fa4c2bd commit 8f098b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Bonsai.Design/ObjectTextVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public override void Show(object value)
public override void Load(IServiceProvider provider)
{
buffer = new Queue<string>();
textBox = new RichTextBox { Dock = DockStyle.Fill };
textBox.ReadOnly = true;
textBox = new RichTextLabel { Dock = DockStyle.Fill };
textBox.Multiline = true;
textBox.WordWrap = false;
textBox.ScrollBars = RichTextBoxScrollBars.Horizontal;
Expand Down
15 changes: 15 additions & 0 deletions Bonsai.Design/RichTextLabel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Windows.Forms;

namespace Bonsai.Design
{
internal class RichTextLabel : RichTextBox
{
public RichTextLabel()
{
ReadOnly = true;
TabStop = false;
SetStyle(ControlStyles.Selectable, false);
SetStyle(ControlStyles.UserMouse, true);
}
}
}

0 comments on commit 8f098b7

Please sign in to comment.