From 6bbfbc2fd45dde929a072a236257d2f166ec45a7 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sun, 5 Feb 2017 02:24:48 +0100 Subject: [PATCH] CTextBox: Fix unselectable textbox of one line --- CTextBox.cs | 5 ++--- FrmCsvViewer.cs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CTextBox.cs b/CTextBox.cs index 504d638..d861e5f 100644 --- a/CTextBox.cs +++ b/CTextBox.cs @@ -9,17 +9,16 @@ namespace CsvView { public CTextBox() { - Multiline = true; WordWrap = false; ScrollBars = ScrollBars.Horizontal; Font = new Font("Courier New", 9, FontStyle.Regular, GraphicsUnit.Point, 0); } - + [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); private const int WM_MOUSEWHEEL = 0x20a; - + protected override void WndProc(ref Message m) { if (m.Msg == WM_MOUSEWHEEL) diff --git a/FrmCsvViewer.cs b/FrmCsvViewer.cs index 148adf7..5194f1a 100644 --- a/FrmCsvViewer.cs +++ b/FrmCsvViewer.cs @@ -185,6 +185,7 @@ namespace CsvView Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right), Width = pnlData.Width - Padding, Height = (valueLines.Length * LineHeight) + TexboxPadding, + Multiline = (valueLines.Length > 1), Top = y, Left = 0, ReadOnly = true,