Board index » delphi » Why does my form text dissappear on Show?

Why does my form text dissappear on Show?

Hi All,

I use the Show method to display a text message while I am doing
something.

eg.  MessageForm.Show;
     {Do calcs and other stuff}
     MessageForm.Close;  

Why is it that the text (TLabel) message and images I placed on the form
does not show while the MessageForm.Show is active?

Any help or light on the matter would be helpful;

PAUL
pa...@maties.sun.ac.za

 

Re:Why does my form text dissappear on Show?


On Wed, 28 May 1997 12:19:03 -0400, Paul Bailey

Quote
<pa...@maties.sun.ac.za> wrote:
>Hi All,

>I use the Show method to display a text message while I am doing
>something.

>eg.  MessageForm.Show;
>     {Do calcs and other stuff}
>     MessageForm.Close;  

>Why is it that the text (TLabel) message and images I placed on the form
>does not show while the MessageForm.Show is active?

>Any help or light on the matter would be helpful;

>PAUL
>pa...@maties.sun.ac.za

Hi, what I think you need to do is one of two things, after showing
the form you could do APPLICATION.PROCESSMESSAGES; this will
definately do the trick, OR something like MESSAGEFORM.REFRESH; (or
UPDATE, can never remember!)

Re:Why does my form text dissappear on Show?


Quote
Paul Bailey wrote:

> Hi All,

> I use the Show method to display a text message while I am doing
> something.

> eg.  MessageForm.Show;
>      {Do calcs and other stuff}
>      MessageForm.Close;

> Why is it that the text (TLabel) message and images I placed on the form
> does not show while the MessageForm.Show is active?

> Any help or light on the matter would be helpful;

> PAUL
> pa...@maties.sun.ac.za

All Show does is make the form visible, but it doesn't guarantee to
fully repaint it. Change your code to:

  MessageForm.Show;
  MessageForm.Refresh;  // force everything to paint NOW
  {Do calcs and other stuff}
  MessageForm.Close;

Chris Jobson

Re:Why does my form text dissappear on Show?


Quote
Paul Bailey <pa...@maties.sun.ac.za> writes:
>Hi All,
>I use the Show method to display a text message while I am doing
>something.
>eg.  MessageForm.Show;
>     {Do calcs and other stuff}
>     MessageForm.Close;  
>Why is it that the text (TLabel) message and images I placed on the form
>does not show while the MessageForm.Show is active?
>Any help or light on the matter would be helpful;

As I recall, I had a similiar sort of problem when I was displaying a splash
screen. I think I solved it eventually by putting a Form.Refresh after the
Show, and it properly displayed all the components on the form.

Quote
>PAUL
>pa...@maties.sun.ac.za

--
Paul Gilbert           | p...@yallara.cs.rmit.edu.au
Bach App Sci, Bach Eng | The opinions expressed are my own, all my own, and
Year 4, RMIT Melbourne | as such will contain no references to small {*word*141}
Australia              | creatures from Alpha Centauri.

Re:Why does my form text dissappear on Show?


Quote
Paul Bailey wrote:

> Hi All,

> I use the Show method to display a text message while I am doing
> something.

> eg.  MessageForm.Show;
>      {Do calcs and other stuff}

Insert inside your loop
        Application.ProcessMessages;

Quote
>      MessageForm.Close;

> Why is it that the text (TLabel) message and images I placed on the form
> does not show while the MessageForm.Show is active?

> Any help or light on the matter would be helpful;

> PAUL
> pa...@maties.sun.ac.za

Doing long calculations hogs the CPU and prevents it from doing other
tasks (like repainting the screen). Application.ProcessMessages passes
the control of the CPU to other tasks.

Radam
ra...@tridel.com.ph

Other Threads