Board index » delphi » Showing things

Showing things

Is there an event that gets called just after a form is shown? I need to
hide the form, but it says +ACI-Cannot change Visible in OnShow or OnHide.+ACI- when
I put it in OnShow.
 

Re:Showing things


What I do for these things is have a timer on the form called tmrAfterShow.
I have initially its Interval set to 1, and its Enabled set to False.

In the OnShow event I have:

procedure TForm1.FormShow(Sender: TObject);
begin
  tmrAfterShow.Enabled := True;
end;

Then I have in the timer:

procedure TForm1.tmrAfterShow(Sender: TObject);
begin
  tmrAfterShow.Enabled := False;
  { Set focus of a control or whatever you want to do that you
    can't normally because the form isn't shown yet }
end;

The timer will only fire after the form is shown.

Cameron
_______________________
cameronm...@hotmail.com

Quote
Steve Hamilton wrote in message ...
>Is there an event that gets called just after a form is shown? I need to
>hide the form, but it says +ACI-Cannot change Visible in OnShow or
OnHide.+ACI- when
>I put it in OnShow.

Re:Showing things


Im Artikel <i%ow2.53$uH2.487...@NewsRead.Toronto.iSTAR.net>, "Steve Hamilton"
<arbu...@istar.ca> schreibt:

Quote
>Is there an event that gets called just after a form is shown? I need to
>hide the form...

I wonder why you want to hide a form, *after* it's shown? You can do so
everywhere in code, when you decide that the form should not be shown any more.

To prevent the form from becoming visible at all, I'd set the Visible property
in e.g. the Create event, or better at design time.

DoDi

Re:Showing things


On Wed, 10 Feb 1999 15:51:07 -0800, "Steve Hamilton"

Quote
<arbu...@istar.ca> wrote:
>Is there an event that gets called just after a form is shown? I need to
>hide the form, but it says +ACI-Cannot change Visible in OnShow or OnHide.+ACI- when
>I put it in OnShow.

Post a user-defined message from OnShow(), and do the work in the
message handler.
------------------------------------
Anders Isaksson, Sweden

BlockCAD: http://user.tninet.se/~hbh828t/proglego.htm
Gallery:  http://user.tninet.se/~hbh828t/gallery.htm

Other Threads