Changing Form1.text at runtime

  • Thread starter Thread starter Ringo
  • Start date Start date
R

Ringo

I have a windows app that downloads Firmware to a micro. I display the
% done on the form, but I would like to put it in the forms title so
that when it is minimized you can see it on the toolbar. It appears
you can't change Form.text at runtime. Is there a way to do it? I've
tried MSDN and googling, but can't find anything.
Thanks
Ringo
 
Ringo said:
I have a windows app that downloads Firmware to a micro. I display the
% done on the form, but I would like to put it in the forms title so
that when it is minimized you can see it on the toolbar. It appears
you can't change Form.text at runtime. Is there a way to do it? I've
tried MSDN and googling, but can't find anything.

Within the form you can change the text, anywhere in the form class itself
you could put this.Text = "percent complete";. As the Text property is
public you can also do this outside the form with an instance back to the
form. Can you post a short but complete program that shows the problem?
 
Ringo said:
I have a windows app that downloads Firmware to a micro. I display the
% done on the form, but I would like to put it in the forms title so
that when it is minimized you can see it on the toolbar. It appears
you can't change Form.text at runtime. Is there a way to do it? I've
tried MSDN and googling, but can't find anything.
Thanks
Ringo

Yes, you can change the text of the form at runtime. The reason that you
don't find anything about it is that there is no problem with it.

The problem is that you are doing it in a loop in the main thread, so
the thread that would recieve the message that the text should change is
busy.

Either do the work in a background thread so that the main thread is not
busy, or use DoEvents in the loop to consume messages every now and then.
 

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