From 3de595c5e50c757bcad696e364353e34021a65aa Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 20 Oct 2019 21:08:08 +0300 Subject: [PATCH] Update MainForm.cs --- Crypto Notepad/MainForm.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index bfdac35..f2875e5 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -430,11 +430,10 @@ private async void StatusPanelMessage(string type) private void StatusPanelTextInfo() { int currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine(); - int currentLine = 0; - using (RichTextBox rtb = new RichTextBox() { WordWrap = false, Text = richTextBox.Text }) - { - currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart); - } + RichTextBox rtb = new RichTextBox(); + rtb.WordWrap = false; + rtb.Text = richTextBox.Text; + int currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart); int linesCount = richTextBox.Lines.Count(); if (linesCount == 0) { @@ -444,6 +443,7 @@ private void StatusPanelTextInfo() statusPaneLinesLabel.Text = "Lines: " + linesCount; statusPaneLnLabel.Text = "Ln: " + currentLine; statusPaneColLabel.Text = "Col: " + currentColumn; + } private void LockFile()