From 336c6c1a25fa06af5d777103512dc913b1a06497 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 11 Nov 2019 21:00:29 +0200 Subject: [PATCH] Added "Unnamed.cnp - Crypto Notepad" to title bar, when typing text in editor with no opened file --- Crypto Notepad/MainForm.cs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index 0d2675d..7ec7e8f 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -986,21 +986,11 @@ private void RichTextBox_TextChanged(object sender, EventArgs e) if (!Text.Contains("*")) { Text = Text.Insert(0, "*"); - } - } - else - { - if (Text.Contains("*")) - { - Text = Text.Replace("*", string.Empty); - } - } - - if (richTextBox.TextLength == 0) - { - if (Text.Contains("*")) - { - Text = Text.Replace("*", string.Empty); + if (string.IsNullOrEmpty(PublicVar.openFileName) & richTextBox.TextLength > 0) + { + Text = "Unnamed.cnp" + " – " + PublicVar.appName; + Text = Text.Insert(0, "*"); + } } } }