I have a peculiar problem with my C# WinForms app (VS 2013). I have an MdiParent form that creates an MdiChild form, but it shows the name of the MdiChild form in its Text property whenever I open a file and put the MdiParent form in full screen mode. Here is the code for entering full screen mode:
private void tsbtnFullScreen_Click(object sender, EventArgs e)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
this.BackColor = SystemColors.ActiveCaptionText;
tsToolStrip.Visible = ssStatusStrip.Visible = false;
}
Instead of seeing this in the MdiParent form's Text property: "My Trivia Game - Trivia Player v1.0"
I see this: "My Trivia Game - Trivia Player v1.0 - [frmGame]"
I tried this after opening a file and creating a new MdiChild form(frmGame):
this.Text = clsGameInfo.strGameTitle + " - " + "Trivia Player v1.0";
And I tried this:
this.Text.Replace (" - [frmGame]", "");
The MdiParent form(this) still reads "My Trivia Game - Trivia Player v1.0 - [frmGame]".
How can I get rid of or prevent " - [frmGame]" from showing up in the MdiParent form's Text property?