diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index dc03e1a..2c4e6b2 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -448,16 +448,22 @@ private void StatusPanelTextInfo() { if (statusPanel.Visible) { - int linesCount = richTextBox.Lines.Length; - - if (linesCount == 0) + if (statusPanelLinesLabel.Visible) { - linesCount = 1; + int linesCount = richTextBox.Lines.Length; + if (linesCount == 0) + { + linesCount = 1; + } + statusPanelLinesLabel.Text = "Lines: " + linesCount; + } + if (statusPanelLengthLabel.Visible) + { + statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength; } - statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength; - statusPanelLinesLabel.Text = "Lines: " + linesCount; } } + private void StatusPanelTimer_Tick(object sender, EventArgs e) { StatusPanelTextInfo(); @@ -969,6 +975,7 @@ private void RichTextBox_TextChanged(object sender, EventArgs e) Text = Text.Replace("*", string.Empty); } } + if (richTextBox.TextLength == 0) { if (Text.Contains("*")) @@ -1075,13 +1082,13 @@ private async void OpenMainMenu_Click(object sender, EventArgs e) PublicVar.openFileName = Path.GetFileName(openFileDialog.FileName); if (!openFileDialog.FileName.Contains(".cnp")) { - if (Visible) + if (Visible) { PublicVar.messageBoxCenterParent = true; } using (new CenterWinDialog(this)) { - DialogResult res = MessageBox.Show(this, "Try to decrypt \"" + PublicVar.openFileName + "\" file?", PublicVar.appName, + DialogResult res = MessageBox.Show(this, "Try to decrypt \"" + PublicVar.openFileName + "\" file?", PublicVar.appName, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (res == DialogResult.No) {