Fixed "Enter Key" window blinking in upper left corner of the screen

This commit is contained in:
Alexander 2019-11-11 20:54:17 +02:00
parent 5b0bd204df
commit 84cebf9a1b
2 changed files with 20 additions and 21 deletions

View file

@ -34,10 +34,10 @@ private void InitializeComponent()
this.mainPanel = new System.Windows.Forms.Panel();
this.lockPictureBox = new System.Windows.Forms.PictureBox();
this.fileNameLabel = new System.Windows.Forms.Label();
this.keyTextBox = new System.Windows.Forms.PlaceholderTextBox();
this.showKeyPictureBox = new System.Windows.Forms.PictureBox();
this.enterKeyFormToolTip = new System.Windows.Forms.ToolTip(this.components);
this.passwordGeneratorButton = new System.Windows.Forms.Button();
this.keyTextBox = new System.Windows.Forms.PlaceholderTextBox();
this.mainPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lockPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.showKeyPictureBox)).BeginInit();
@ -89,20 +89,6 @@ private void InitializeComponent()
this.fileNameLabel.Text = "File name";
this.fileNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// keyTextBox
//
this.keyTextBox.Location = new System.Drawing.Point(64, 39);
this.keyTextBox.Name = "keyTextBox";
this.keyTextBox.Placeholder = "Encryption key";
this.keyTextBox.PlaceholderActiveForeColor = System.Drawing.Color.DarkGray;
this.keyTextBox.PlaceholderFont = new System.Drawing.Font("Segoe UI", 8.25F);
this.keyTextBox.PlaceholderForeColor = System.Drawing.Color.DarkGray;
this.keyTextBox.Size = new System.Drawing.Size(206, 22);
this.keyTextBox.TabIndex = 0;
this.keyTextBox.UseSystemPasswordChar = true;
this.keyTextBox.TextChanged += new System.EventHandler(this.KeyTextBox_TextChanged);
this.keyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyTextBox_KeyDown);
//
// showKeyPictureBox
//
this.showKeyPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -128,6 +114,20 @@ private void InitializeComponent()
this.passwordGeneratorButton.UseVisualStyleBackColor = true;
this.passwordGeneratorButton.Click += new System.EventHandler(this.PasswordGeneratorButton_Click);
//
// keyTextBox
//
this.keyTextBox.Location = new System.Drawing.Point(64, 39);
this.keyTextBox.Name = "keyTextBox";
this.keyTextBox.Placeholder = "Encryption key";
this.keyTextBox.PlaceholderActiveForeColor = System.Drawing.Color.DarkGray;
this.keyTextBox.PlaceholderFont = new System.Drawing.Font("Segoe UI", 8.25F);
this.keyTextBox.PlaceholderForeColor = System.Drawing.Color.DarkGray;
this.keyTextBox.Size = new System.Drawing.Size(206, 22);
this.keyTextBox.TabIndex = 0;
this.keyTextBox.UseSystemPasswordChar = true;
this.keyTextBox.TextChanged += new System.EventHandler(this.KeyTextBox_TextChanged);
this.keyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KeyTextBox_KeyDown);
//
// EnterKeyForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -142,7 +142,6 @@ private void InitializeComponent()
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EnterKeyForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Crypto Notepad";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.EnterKeyForm_FormClosed);
this.Load += new System.EventHandler(this.EnterKeyForm_Load);

View file

@ -28,11 +28,6 @@ private void EnterKeyForm_Load(object sender, EventArgs e)
fileNameLabel.Text = PublicVar.openFileName;
Properties.Settings settings = Properties.Settings.Default;
TopMost = settings.alwaysOnTop;
}
private void EnterKeyForm_Shown(object sender, EventArgs e)
{
fileNameLabel.Text = PublicVar.openFileName;
MainForm main = Owner as MainForm;
if (main.Visible)
{
@ -43,6 +38,11 @@ private void EnterKeyForm_Shown(object sender, EventArgs e)
CenterToScreen();
}
}
private void EnterKeyForm_Shown(object sender, EventArgs e)
{
fileNameLabel.Text = PublicVar.openFileName;
}
/*Form Events*/