Pop up a form with a temporary message

  • Thread starter Thread starter Michael A. Covington
  • Start date Start date
M

Michael A. Covington

I want to define a form that has a textbox on it, and at some stages in my
program:

- create the form
- put a message in the textbox
- show the form
- do a time-consuming computation
- close the form

Currently, the form appears at the right time but the textbox always comes
out blank. What order should I be doing things in, and are some Update or
Refresh calls needed?

Thanks to all!
 
There are a number of ways to skin this particular cat. One way:
Create an overload of the Form ctor that accepts a string message parameter
that gets stored in a private string field in the Form class.
In Form_Load, just set the Text value of the TextBox to the string message
field's value. When the form is shown, the text should be visible.
Peter
 
Many thanks. I'll try that.

Peter Bromberg said:
There are a number of ways to skin this particular cat. One way:
Create an overload of the Form ctor that accepts a string message
parameter
that gets stored in a private string field in the Form class.
In Form_Load, just set the Text value of the TextBox to the string message
field's value. When the form is shown, the text should be visible.
Peter
 
It works if I do an Application.DoEvents() right after formPopUp.Show().
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top