<p>I've got an MDI application written in Delphi 2006 which runs XP with the default theme. </p>

<p>Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? </p>

<p>I've tried setting the <code>BorderStyle</code> of the <code>MDIChildren</code> to <code>bsSizeToolWin</code> but they are still rendered as normal Forms.</p>

[{'answer_id': 8792, 'author': 'onnodb', 'author_id': 1037, 'author_profile': 'https://Stackoverflow.com/users/1037', 'pm_score': 0, 'selected': False, 'text': "<p>I don't think there is; in my experience, MDI in Delphi is very strictly limited and controlled by its implementation in the VCL (and perhaps also by the Windows API?). For example, don't try hiding an MDI child (you'll get an exception if you try, and you'll have to jump through a couple of API hoops to work around that), or changing the way an MDI child's main menu is merged with the host form's.</p>\n\n<p>Given these limitations, perhaps you should reconsider why you'd like to have special title bars in the first place? I guess there are also good reasons why this MDI stuff is standardized --- your users might appreciate it :)</p>\n\n<p>(PS: nice to see a Delphi question around here!)</p>\n"}, {'answer_id': 8852, 'author': 'Marius', 'author_id': 1008, 'author_profile': 'https://Stackoverflow.com/users/1008', 'pm_score': 0, 'selected': False, 'text': '<p>Thanks onnodb</p>\n\n<p>Unfortunately the client insists on MDI and the smaller title bar.</p>\n\n<p>I have worked out one way of doing it which is to hide the title bar by overriding the windows CreateParams and then create my own title bar (simple panel with some Mouse handling for moving). Works well enough so I think I might run it by the client and see if it will do...</p>\n'}, {'answer_id': 8868, 'author': 'Tim Sullivan', 'author_id': 722, 'author_profile': 'https://Stackoverflow.com/users/722', 'pm_score': 2, 'selected': False, 'text': '<p>The way MDI works doesn\'t gel with what you\'re trying to do.</p>\n\n<p>If you need the "MDI" format, you should consider using either the built-in or a <a href="http://www.automatedqa.com/products/aqdocking/index.asp" rel="nofollow noreferrer">commercial</a> docking package, and use the docking setup to mimic the MDI feel. </p>\n\n<p>In my Delphi apps, I frequently use TFrames and parent them to the main form, and maximizing them so they take up the client area. This gives you something similar to how Outlook looks. It goes a little something like this:</p>\n\n<pre><code>TMyForm = class(TForm)\nprivate\n  FCurrentModule : TFrame;\npublic\n  property CurrentModule : TFrame read FModule write SetCurrentModule;\nend;\n\nprocedure TMyForm.SetCurrentModule(ACurrentModule : TFrame);\nbegin\n  if assigned(FCurrentModule) then\n    FreeAndNil(FCurrentModule);  // You could cache this if you wanted\n  FCurrentModule := ACurrentModule;\n  if assigned(FCurrentModule) then\n  begin\n    FCurrentModule.Parent := Self;\n    FCurrentModule.Align := alClient;\n  end;\nend;\n</code></pre>\n\n<p>To use it, you can simply do this:</p>\n\n<pre><code>MyForm.CurrentModule := TSomeFrame.Create(nil);\n</code></pre>\n\n<p>There is a good argument that you should use interfaces (creating an IModule interface or something) that you use. I often do that, but it\'s more complex than needed to explain the concept here.</p>\n\n<p>HTH</p>\n'}, {'answer_id': 161214, 'author': 'CoolMagic', 'author_id': 22641, 'author_profile': 'https://Stackoverflow.com/users/22641', 'pm_score': 4, 'selected': True, 'text': '<p>All your need - overload procedure CreateWindowHandle, like this:</p>\n\n<pre><code>unit CHILDWIN;\ninterface\nuses Windows, Classes, Graphics, Forms, Controls, StdCtrls;\n\ntype\n  TMDIChild = class(TForm)\n  private\n    { Private declarations }\n  public\n    { Public declarations }\n    procedure CreateWindowHandle(const Params: TCreateParams); override;\n  end;\n\nimplementation\n\n{$R *.dfm}\nprocedure TMDIChild.CreateWindowHandle(const Params: TCreateParams);\nbegin\n  inherited CreateWindowHandle(Params);\n  SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);\nend;\nend.\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/8728', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1008/']