all groups > dotnet compact framework > february 2005 >
You're in the

dotnet compact framework

group:

How to force screen update



How to force screen update Tim Johnson
2/27/2005 12:16:32 AM
dotnet compact framework: I know this has to be something really simple, but I have 2 questions:

1. How do you suppress painting of a form while doing some lengthy form_load
stuff? I get bits and pieces of the form showing up before the final form
appears.

2. How do you force a label text-change to appear immediately? I'm doing a
web-service call on a timer tick, and I don't want to use the wait-cursors.
So I update a status label with something like "Please wait...", then make
the web-service call, then update it with "Uploaded 10 records". Only the
2nd message appears. I've tried label.Invalidate() and this.Invalidate(),
with and without a Thread.Sleep(0). What am I missing?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625


Re: How to force screen update Alex Feinman [MVP]
2/27/2005 2:39:07 AM
[quoted text, click to view]

Create a generic Controll that has size set to Form.ClientRectangle and
bring it to front. That should keep you form from displaying any controls.
If you want to get creative, ether implement soem custom painting on this
control, or use a picturebox
[quoted text, click to view]

Call Application.DoEvents
Re: How to force screen update Tim Johnson
2/27/2005 8:24:35 AM
Thanks, both tips worked great!

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625


[quoted text, click to view]

Re: How to force screen update Sergey Bogdanov
2/27/2005 12:41:35 PM
You can not suppress window changes redraw, since WM_SETREDRAW message
works for Combobox, Treeview, Listbox but not for a Form. But if you
want that your "Please wait..." message will display first on a form
then put it on the first line of form constructor and call
"Application.DoEvents" to process window message queue. It also applies
as an answer for the second question.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


[quoted text, click to view]
AddThis Social Bookmark Button