Solved

Minimizing forms without borders

Posted on 1998-11-30
4
517 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now