Solved

Minimizing forms without borders

Posted on 1998-11-30
4
526 Views
Last Modified: 2010-04-04
I have a form which has BorderStyle set to bsNone. When I call Minimize it minimizes to a little rectangle just above the start button. How do I make it minimize like normal forms? Is it perhaps some other property which is involved?
0
Comment
Question by:red_2
4 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1348611
Tried Application.Restore - Application.Minimize ?

/// John
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1348612
Please try the following:

type
  TForm1 = class(TForm)
  private
    { Private-Deklarationen }
    procedure SysCommand     (var Message: TWMSYSCOMMAND);        message WM_SYSCOMMAND;
  end;


procedure TForm1.SysCommand(var Message: TWMSYSCOMMAND);
begin
  if Message.CmdType and $FFF0 = SC_MINIMIZE then begin
    ShowWindow(handle,SW_MINIMIZE);
  end else inherited;
end;

Don't know if it works. Haven't tested it. Just a try...

Regards, Madshi.
0
 

Expert Comment

by:elkiors
ID: 1348613
Surely only the Application.Mainform will minimize to the taskbar, all other forms are subforms that will only sit 'above' the status bar ie within the desktop area.

Darren

0
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
ID: 1348614
This is the way Windows should normally be dealing with it. Try:

  WindowState:= wsMinimized;
  ShowWindow(Handle,SW_HIDE);

But the one you want is this:

  Application.Minimize;
  ShowWindow(Handle,SW_HIDE);


Try it with a button on a form with BorderStyle = bsNone.

/Williams
0

Featured Post

Technology Partners: 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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 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