Minimize child form

Please discuss general Delphi programming topics here.

Minimize child form

Postby Codius » January 8th, 2007, 8:54 am

I'm writing an application which requires child forms, when I finally got the child forms working I found this new problem.. When I maximize the child form there is no way to resize it manually anymore.. there is no system buttons to turn it back to none-maximized.. ofcourse I could create a button to do this on my own, but then I don't know how to get the icon windows uses for undo-maximize..
So, easy put.. how can I create my own system buttons?
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby Johnny_Bit » January 10th, 2007, 8:00 pm

hmm... you sure you did it right? normally, when one does it right there are buttons just below your app's system buttons, and I see no way of them not being there if you did it right.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby kokkoras » January 14th, 2007, 2:27 am

If your main app is MDI and the child windows are ...well, MDI children, then everything should work fine.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Codius » January 18th, 2007, 7:30 pm

I'm using a Coolbar or whatever it's called with align Top, could this block the buttons or something?
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby kokkoras » January 18th, 2007, 8:31 pm

Codius wrote:I'm using a Coolbar or whatever it's called with align Top, could this block the buttons or something?


Nop! The buttons you have mentioned are located in the window frame; not inside the client area. Try creating a demo MDI app using the New Project option fron the Delphi IDE and compare the code with yours.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » January 18th, 2007, 10:53 pm

Be sure BorderStyle property of the child form is set to bsSizeable.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2421
Joined: March 7th, 2003, 7:10 pm

And the answer is......

Postby eashton » January 24th, 2007, 7:20 pm

I was also having this problem and believe that I have the answer and it will annoy you. Add a tmenu component to the form.

That's it! Unfortunately, if you have nothing to put on the menu a gray bar appears.

Cheers
Elliot
eashton
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2007, 7:16 pm

Postby Kambiz » January 24th, 2007, 7:51 pm

:o
I'm very intrested on experiencing the case by myself. Is it possible to provide a sample and simple program and post it here?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2421
Joined: March 7th, 2003, 7:10 pm

Recreating the MDI problem

Postby eashton » January 24th, 2007, 9:53 pm

Kambiz,

This is how to recreate (D6 Update 2):

1. Create new App and set formstyle to mdiform
2. Create new form and make formstyle mdichild
3. Run App and maximise child form. At this point you cannot minimise the child form only the entire App.

Now exit the App and add a tmainmenu (you do not need to add any menu items) component to the mdiform (main form) and rerun the App. Now maximise the child form and you will note that the child form now has its form controls buttons displayed.

Cheers
Elliot
eashton
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2007, 7:16 pm

Postby kokkoras » January 25th, 2007, 12:34 am

It seems that the TMenu component alters some properties of the main form. Otherwose it looks like an "issue" (or "feature") :lol:
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » January 25th, 2007, 12:49 pm

I just got what was the issue. :lol:

It's not a bug of Delphi for sure. I don't think that it's a Windows bug either. The MDI forms have been always with menus.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2421
Joined: March 7th, 2003, 7:10 pm

Postby Johnny_Bit » January 25th, 2007, 5:53 pm

Well, it's well known fact about drawing and putting buttons... In Linux there are widgets that can draw every required button on mdi child even if parent doesn't have menu at all, however on windows it's due to non-brilliant programmers, who think that only possible place is parent-window menu-bar.

I hope they are ashamed of themselves.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron