Board index » delphi » Window Captions

Window Captions

Does anyone know how to remove the caption from the window.
In vb all you have to do is eliminate all of the caption buttons and the
caption and set the borderstyle to something.
How do you do this in Delphi. I tried eliminating all of the buttons,
wiped the caption, and tried different borederstyles, but nothing works!

 

Re:Window Captions


Iman Example <exam...@aristotle.net> wrote in article
<01bc7283$be5ed720$5152f0c7@default>...

Quote
> Does anyone know how to remove the caption from the window.
> In vb all you have to do is eliminate all of the caption buttons and the
> caption and set the borderstyle to something.
> How do you do this in Delphi. I tried eliminating all of the buttons,
> wiped the caption, and tried different borederstyles, but nothing works!

Here's how I get rid of the normal "Window" look, including the caption
line:

In each Form add the following:

INTERFACE
...
  PRIVATE
    PROCEDURE CreateParams(VAR Params:  TCreateParams);  OVERRIDE;
...

IMPLEMENTATION
...
PROCEDURE TFormIntroduction.CreateParams(VAR Params:  TCreateParams);
BEGIN
  Inherited CreateParams(Params);
  WITH Params DO
    Style := (Style OR WS_POPUP) AND
             (NOT (WS_BORDER OR WS_THICKFRAME OR WS_DLGFRAME))
END {CreateParams};

_________________________________________________

Earl F. Glynn          EarlGl...@WorldNet.att.net
EFG Software              913/859-9557  Voice/Fax
   Scientific/Engineering/Medical Applications
             Overland Park, KS  USA

Re:Window Captions


What happens if you say Form.Caption := ' '; ?

-B

Re:Window Captions


The only thing I've found to work is to set the BorderStyle to bsNone.
You can't resize the window then though.

Hope this helps.
Matt

Re:Window Captions


I believe it substitutes the name of your form variable for the Caption.

I tried to make blank captions by doing as you show in your note and that's
what happened to me :-(.
--
Mark Bratcher
mbra...@ix.netcom.com

DBradDavis <dbradda...@aol.com> wrote in article
<19970606221800.SAA06...@ladder02.news.aol.com>...

Quote
> What happens if you say Form.Caption := ' '; ?

> -B

Re:Window Captions


I believe it substitutes the name of your form variable for the Caption.

I tried to make blank captions by doing as you show in your note and that's
what happened to me :-(.
--
Mark Bratcher
mbra...@ix.netcom.com

DBradDavis <dbradda...@aol.com> wrote in article
<19970606221800.SAA06...@ladder02.news.aol.com>...

Quote
> What happens if you say Form.Caption := ' '; ?

> -B

Re:Window Captions


Quote
Matt Sollars wrote:

> The only thing I've found to work is to set the BorderStyle to bsNone.
> You can't resize the window then though.

> Hope this helps.
> Matt

Why not use:

TForm1.Caption := '  ';

Regards,
Frederik.

Re:Window Captions


Try it. I think you'll find that Delphi (or WIndows?) will load the form's
name into the Caption if you try to set it to blank.
--
Mark Bratcher
mbra...@ix.netcom.com

F.J. Slijkerman <fjsl...@wins.uva.nl> wrote in article
<339BE7C3....@wins.uva.nl>...

Quote
> Matt Sollars wrote:

> > The only thing I've found to work is to set the BorderStyle to bsNone.
> > You can't resize the window then though.

> > Hope this helps.
> > Matt

> Why not use:

> TForm1.Caption := '  ';

> Regards,
> Frederik.

Other Threads