Re: popup form in indy thread

Giganews Newsgroups
Subject: Re: popup form in indy thread
Posted by:  Lee_Nover (Lee_Nover[nospam]@delphi-si.com)
Date: Tue, 11 May 2004

create the form in the calling thread and show it modaly !
with TMessageForm.Create(nil) do
try
  ShowModal;
finally
  Free;
end;

otherwise you will need to do some synchronizing

"John Smith" <thecod…@163.com> wrote in message
news:Xns94E6979C8AC4Fthecoder163c…@66.221.34.76...
> I have an Indy 9 TcpServer listen for command,When it get a command,it
> pops up a form which has a frame in it,and there are a TRichEdit,a
> TComboBox,a TComboBoxEx,two TLabel and a TButton control in the
> frame.when the form pops up,only TComboBoxEx and two TLabels
> displayed,all other controls disapeared,why?the form pops up in
> TIdTCPServer.Execute method.thanks.
>
> procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
> var
>  Command : string;
> begin
>  with AThread.Connection do
>  begin
>    Command := ReadLn;
>    if (Command = 'Message') and Assinged(MessageForm) then
>    MessageForm.Show;
>  end;
> end;

Replies

None

In response to

popup form in indy thread posted by John Smith on Tue, 11 May 2004