Search code examples
delphiformshidevisible

Delphi hiding a form: Is there a difference between Form.Hide and Form.Visible:=False?


I'm looking through two copies of code and in one I have myForm.Hide and another I have myForm.Visible := False. I can't remember why I changed this, if one was a bug fix or whether there is any difference at all.


Solution

  • There is no difference for Hide. The VCL code is:

    procedure TCustomForm.Hide;
    begin
      Visible := False;
    end;
    

    But Show is a bit different:

    procedure TCustomForm.Show;
    begin
      Visible := True;
      BringToFront;
    end;