delphifullscreenvcldelphi-2007

What is the best way to make a Delphi Application completely full screen?


What is the best way to make a Delphi application (Delphi 2007 for Win32) go completely full screen, removing the application border and covering the Windows Taskbar?

I am looking for something similar to what Internet Explorer (IE) does when you hit F11.

I wish this to be a run time option for the user not a design time decision by my good self.

As mentioned in the accepted answer

BorderStyle := bsNone; 

was part of the way to do it. Strangely I kept getting an E2010 Incompatible types: 'TFormBorderStyle' and 'TBackGroundSymbol' error when using that line (another type had bsNone defined).

To overcome this I had to use:

BorderStyle := Forms.bsNone;

Solution

  • Well, this has always worked for me. Seems a bit simpler...

    procedure TForm52.Button1Click(Sender: TObject);
    begin
      BorderStyle := bsNone;
      WindowState := wsMaximized;
    end;