How to remove MDI child text from the parent form title bar? C # .NET

I have a form that acts as the parent form of MDI and several other forms as the parent of MDI. The child windows have FormBorderStyle.None and ControlBox = false, so that the border material from the MDI child elements is not displayed in the parent MDI. But MDI children work as much as possible in my application, and in this case the title text of the main form window always includes the text of the child form, for example:

  + - + --------------------------------------- + ------ - +
 |  |  Main window title - [Child title] |  _ O x |
 + - + --------------------------------------- + ------ - +
 |  |
 ...

How can I get rid of the "- [Child title]" part in the main title bar? I looked at the Form.Text property and it includes the full title that appears on the screen. But setting the text to something else only changes the first part, the child header is always added and cannot be deleted in this way. I have a short walk, although the .NET Reflector did not lead to anything interesting.

+4
source share
1 answer

You can change the Form.Text property of the child windows to an empty string, so the title will only display "MainWindowTitle".

+1
source

All Articles