Formatting code

This commit is contained in:
Alexander 2019-11-07 20:15:41 +02:00
parent 8b8cb8789d
commit 9c2b77755e

View file

@ -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)
{