Ivanov_G
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ???
> 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 ???
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
meikl ;-)