Board index » cppbuilder » alClient-aligned MDI child exceeds borders

alClient-aligned MDI child exceeds borders

Hello everybody,

When I start an MDI app and try to align the child windows by the
following code snip

void __fastcall TMainForm::ModelName1Execute(TObject *Sender)
{
   if (ResetKernel() == true)
   {
      if (NameDlg->Execute() == true)
      {
         PointsExtractForm = new TPointsExtractForm(Application); //
create one child window
         PointsExtractForm->Top = ClientHeight - 100;
         PointsExtractForm->Align = alClient;
         PlateChildForm = new TPlateChildForm(Application); // create
the next
         PlateChildForm->Align = alTop;
      }
   }

Quote
}

they are not bound by their MDI frame window's client area but exceed it
so that scrollbars are shown. The same occurs if one explicitely use the
ClientWidth property of the MDI frame to set the width of the children.
What's wrong with my understanding of the alignment? I've read several
problems of similar contents on www.mers.com but didn't find a
satisfying solution.

Thanks,

Marold

 

Re:alClient-aligned MDI child exceeds borders


: Marold Moosrainer <Marold.Moosrai...@unibw-muenchen.de> wrote:

Quote
>         PointsExtractForm->Align = alClient;

Don't use it. Set

  PointsExtractForm->Width = TheMainForm->ClientWidth

manually.

--
General information:
  * Post to the right group - http://www.borland.com/newsgroups/
    * Do not cross- or multipost
      * Research at http://www.mers.com/searchsite.html

Stefan Hoffmeister - http://www.econos.de/
(TeamB - http://www.teamb.com/)

Re:alClient-aligned MDI child exceeds borders


Quote
"Stefan Hoffmeister (TeamB)" wrote:
> : Marold Moosrainer <Marold.Moosrai...@unibw-muenchen.de> wrote:

> >         PointsExtractForm->Align = alClient;

> Don't use it. Set

>   PointsExtractForm->Width = TheMainForm->ClientWidth

> manually.

Sorry to insist on this annoying problem but the result still is not
what I want. For the moment I am still using the autocreated MDI wizard
parent form and the code snip is:
void __fastcall TMainForm::InitModelAndLog(AnsiString nameTag)
{
   PlateChildForm = new TPlateChildForm(Application);
   PlateChildForm->Left = 0;
   PlateChildForm->Top = 0;
   PlateChildForm->Width = ClientWidth;
   PlateChildForm->Height = ClientHeight - ToolBar2->Height -
StatusBar->Height;
    .
    .

Quote
}

Heaven (or perhaps you?)  knows why there still is an extra length and
height of the child form exceeding the borders of the main form.
Therefore scrollbars appear. I tried to suppress them by setting the
main form's properties AutoScroll=false and
Horz/VertScrollBar->Visible=false but no success.

Marold

Quote

> --
> General information:
>   * Post to the right group - http://www.borland.com/newsgroups/
>     * Do not cross- or multipost
>       * Research at http://www.mers.com/searchsite.html

> Stefan Hoffmeister - http://www.econos.de/
> (TeamB - http://www.teamb.com/)

Re:alClient-aligned MDI child exceeds borders


: Marold Moosrainer <Marold.Moosrai...@unibw-muenchen.de> wrote:

Quote
>   PlateChildForm->Height = ClientHeight - ToolBar2->Height -
>StatusBar->Height;

This smells as if you have a main menu? If you have one, that will mess up
your calculations.

--
General information:
  * Post to the right group - http://www.borland.com/newsgroups/
    * Do not cross- or multipost
      * Research at http://www.mers.com/searchsite.html

Stefan Hoffmeister - http://www.econos.de/
(TeamB - http://www.teamb.com/)

Other Threads