Added indicator (*) in main window title while text is modified

This commit is contained in:
Alexander 2019-11-05 22:54:16 +02:00
parent b5b49ec535
commit dea6afad84

View file

@ -603,6 +603,16 @@ public void ToolbarIcons(bool oldIcons)
#region Event Handlers
private void RichTextBox_ModifiedChanged(object sender, EventArgs e)
{
if (richTextBox.Modified == false)
{
if (Text.Contains("*"))
{
Text = Text.Substring(0, Text.Length - 1);
}
}
}
private void StatusPanel_VisibleChanged(object sender, EventArgs e)
{
if (statusPanel.Visible)
@ -854,6 +864,29 @@ private void RichTextBox_DragDrop(object sender, DragEventArgs e)
private void RichTextBox_TextChanged(object sender, EventArgs e)
{
statusPanelTimer.Start();
if (richTextBox.Modified)
{
if (!Text.Contains("*"))
{
Text += "*";
}
}
else
{
if (Text.Contains("*"))
{
Text = Text.Substring(0, Text.Length - 1);
}
}
if (richTextBox.TextLength == 0)
{
if (Text.Contains("*"))
{
Text = Text.Substring(0, Text.Length - 1);
}
}
}
private void StatusPanelLabel_TextChanged(object sender, EventArgs e)