From 52c9adc0442667fecf61bb36612f6496edbf03f0 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 19 Nov 2019 16:08:12 +0200 Subject: [PATCH] Fixed bug with file name when creating the new file --- Crypto Notepad/MainForm.Designer.cs | 42 ++++++++++++++--------------- Crypto Notepad/MainForm.cs | 1 + 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Crypto Notepad/MainForm.Designer.cs b/Crypto Notepad/MainForm.Designer.cs index 0a7835e..a373798 100644 --- a/Crypto Notepad/MainForm.Designer.cs +++ b/Crypto Notepad/MainForm.Designer.cs @@ -119,13 +119,13 @@ public void InitializeComponent() this.fileLockedPanel = new System.Windows.Forms.Panel(); this.fileLockedCloseButton = new System.Windows.Forms.Button(); this.fileLockedOkButton = new System.Windows.Forms.Button(); - this.fileLockedKeyTextBox = new System.Windows.Forms.PlaceholderTextBox(); this.fileLockedShowKey = new System.Windows.Forms.PictureBox(); this.fileLockedLabel = new System.Windows.Forms.Label(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.richTextBoxPanel = new System.Windows.Forms.Panel(); - this.richTextBox = new Crypto_Notepad.ExRichTextBox(); this.statusPanelTimer = new System.Windows.Forms.Timer(this.components); + this.fileLockedKeyTextBox = new System.Windows.Forms.PlaceholderTextBox(); + this.richTextBox = new Crypto_Notepad.ExRichTextBox(); this.mainMenu.SuspendLayout(); this.contextMenu.SuspendLayout(); this.searchPanel.SuspendLayout(); @@ -1124,20 +1124,6 @@ public void InitializeComponent() this.fileLockedOkButton.UseVisualStyleBackColor = true; this.fileLockedOkButton.Click += new System.EventHandler(this.FileLockedOkButton_Click); // - // fileLockedKeyTextBox - // - this.fileLockedKeyTextBox.Location = new System.Drawing.Point(6, 34); - this.fileLockedKeyTextBox.Name = "fileLockedKeyTextBox"; - this.fileLockedKeyTextBox.Placeholder = "Encryption key"; - this.fileLockedKeyTextBox.PlaceholderActiveForeColor = System.Drawing.Color.DarkGray; - this.fileLockedKeyTextBox.PlaceholderFont = new System.Drawing.Font("Segoe UI", 8.25F); - this.fileLockedKeyTextBox.PlaceholderForeColor = System.Drawing.Color.DarkGray; - this.fileLockedKeyTextBox.Size = new System.Drawing.Size(231, 22); - this.fileLockedKeyTextBox.TabIndex = 8; - this.fileLockedKeyTextBox.UseSystemPasswordChar = true; - this.fileLockedKeyTextBox.TextChanged += new System.EventHandler(this.FileLockedKeyTextBox_TextChanged); - this.fileLockedKeyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FileLockedKeyTextBox_KeyDown); - // // fileLockedShowKey // this.fileLockedShowKey.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -1180,6 +1166,25 @@ public void InitializeComponent() this.richTextBoxPanel.Size = new System.Drawing.Size(504, 186); this.richTextBoxPanel.TabIndex = 21; // + // statusPanelTimer + // + this.statusPanelTimer.Interval = 1; + this.statusPanelTimer.Tick += new System.EventHandler(this.StatusPanelTimer_Tick); + // + // fileLockedKeyTextBox + // + this.fileLockedKeyTextBox.Location = new System.Drawing.Point(6, 34); + this.fileLockedKeyTextBox.Name = "fileLockedKeyTextBox"; + this.fileLockedKeyTextBox.Placeholder = "Encryption key"; + this.fileLockedKeyTextBox.PlaceholderActiveForeColor = System.Drawing.Color.DarkGray; + this.fileLockedKeyTextBox.PlaceholderFont = new System.Drawing.Font("Segoe UI", 8.25F); + this.fileLockedKeyTextBox.PlaceholderForeColor = System.Drawing.Color.DarkGray; + this.fileLockedKeyTextBox.Size = new System.Drawing.Size(231, 22); + this.fileLockedKeyTextBox.TabIndex = 8; + this.fileLockedKeyTextBox.UseSystemPasswordChar = true; + this.fileLockedKeyTextBox.TextChanged += new System.EventHandler(this.FileLockedKeyTextBox_TextChanged); + this.fileLockedKeyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FileLockedKeyTextBox_KeyDown); + // // richTextBox // this.richTextBox.AcceptsTab = true; @@ -1200,11 +1205,6 @@ public void InitializeComponent() this.richTextBox.TextChanged += new System.EventHandler(this.RichTextBox_TextChanged); this.richTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RichTextBox_KeyDown); // - // statusPanelTimer - // - this.statusPanelTimer.Interval = 1; - this.statusPanelTimer.Tick += new System.EventHandler(this.StatusPanelTimer_Tick); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index 5f06ad4..e7ce955 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -1051,6 +1051,7 @@ private void NewMainMenu_Click(object sender, EventArgs e) if (!PublicVar.okPressed) { + PublicVar.openFileName = ""; if (!string.IsNullOrEmpty(filePath)) { PublicVar.openFileName = Path.GetFileName(filePath);