Link to home
Start Free TrialLog in
Avatar of Ivanov_G
Ivanov_GFlag for Bulgaria

asked on

Problem with MDIChild, wsMaximized and inheriting Base form...

Here is the problem. I have one form called TfrmBaseForm, which is inherited in all other forms. It is 500x700, fsMDIChild.

Let's say I have TForm1 = class(TfrmBaseForm). The size of TForm1 is 400x600. I put a button in the bottom right corner of the form and set its Anchors - Bottom and Right = True, Top and Left = False;

When I show the form, the button is not visible, because the form shows with some different size. The same problem is if the form is WindowsState = wsMaximized...

I am using D7.
Avatar of kretzschmar
kretzschmar
Flag of Germany image

guess you you should set the top/left and anchor-properties at runtime for this case

meikl ;-)
ASKER CERTIFIED SOLUTION
Avatar of DarkCore_
DarkCore_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ivanov_G

ASKER

DarkCore_, I have method similar to yours, but I use Self.MDIChildren, instead of Screen.Forms.

> guess you you should set the top/left and anchor-properties at runtime for this case
I mean to set the Anchors for every button on the form ???
Avatar of DarkCore_
DarkCore_

Well, then your method is in your mainform, not in your mdichild form. with this method you can do something like

  TMyChildForm1.showForm;
  TMyChildForm2.showForm;

and you will create the form if it not exists or show it ( and bring to front ) if is already created. Then, try the sequence for showing it ... have you tried it? I've not any kind of problem with _exactly_ this sequence. I got problems ( not only with buttons, too with unresized panels and unresized PageControls ) time ago, but this works perfect for me.

Edu
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial