[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Hide MDI Form on MiniMize

Posted on 2006-05-02
4
Medium Priority
?
559 Views
Last Modified: 2010-04-05

I have tried this:


type
   TForm1 = class(TForm)
   public
     procedure WMSize(var M : TWMSIZE) ;
               Message WM_Size;
   end;

implementation

procedure TForm1.WMSize(var M:TWMSIZE) ;
begin
   if M.SizeType=Size_Minimized then
     showwindow(Handle,Sw_Hide) ;
end;

But .... When I resized the Form it does not Resize as expected.

Alo I have Panels Located on the "Left Side" and "Bottom" of my main MDI Form,
When I place Controls on these forms the BackGround Color is that of the Main MDI Form.
I want it to be Different. I want my Main MDI Backgroud Colour to be clGray and the rest of my application to be clBtnFace.

How do I resolved this.


0
Comment
Question by:crestty
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
A. Cristian Csiki earned 1500 total points
ID: 16585929
hy, try this:

public
   procedure WMSysCommand
     (var Msg: TWMSysCommand) ;
message WM_SYSCOMMAND;

procedure TForm1.WMSysCommand;
begin
   if (Msg.CmdType = SC_MINIMIZE) then
  ShowWindow(Application.Handle, SW_HIDE);
    DefaultHandler(Msg) ;
end;
0
 

Author Comment

by:crestty
ID: 16586632
public
   procedure WMSysCommand
     (var Msg: TWMSysCommand) ;
message WM_SYSCOMMAND;

procedure TForm1.WMSysCommand;
begin

   DefaultHandler(Msg) ; //<<<<<<<<<<<<<<<<<<---Must be first.

   if (Msg.CmdType = SC_MINIMIZE) then
      ShowWindow(Application.Handle, SW_HIDE);
   end;


That Actually Works.


=======================================================
   My Panels that Changes to the BAckGround Colour of the Main MDI Form,
   how can I stop this from happening ?
=======================================================




0
 
LVL 7

Expert Comment

by:kfoster11
ID: 16602088
try turning off the property form.parentcolor and see if that fixes the color problem.
0
 
LVL 7

Expert Comment

by:kfoster11
ID: 16602093
sry not the forms property the controls property

control.parentcolor := false;
control.color := clblue;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month18 days, 17 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question