tags:

views:

811

answers:

1

I have a form that acts as MDI parent form and several other forms as MDI child. The child windows have FormBorderStyle.None and ControlBox = false so that no border stuff from the MDI children is displayed in the MDI parent. But the MDI children run maximised in my application and in that case, the main form window title text always includes the child form text, like this:

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

How can I get rid of the "- [Child title]" part in the main title bar? I have watched the Form.Text property and it does include the full title that is visible on the screen. But setting the Text to something else only changes the first part, the child title is always added and cannot be removed this way. I brief walk though .NET Reflector didn't lead to anything interesting.

+1  A: 

You can change the Form.Text property of child windows to empty string, that way the titlebar will only display "MainWindowTitle".

erelender
I am working on an MDI project right now. I have just tried it and "-" is not displayed.
erelender
@ThePower: what .net framework version are you using? i tried on 3.5 sp1 and the dash isn't visible.
Can
Oh, ehm, yes, setting the MDI child window title to empty. I tried to avoid that because my custom MDI tab control reads the MDI child window title and displays it in the tab bar. I hoped there was another way to simply deactivate that automatic behaviour.BTW, using .NET 2.0 and .NET 3.5 SP1 here.
LonelyPixel