This is a migrated thread and some comments may be shown as answers.

RadForm looses Skin when Event Processing Blocks

1 Answer 31 Views
Form
This is a migrated thread and some comments may be shown as answers.
erwin
Top achievements
Rank 1
Veteran
erwin asked on 29 Dec 2008, 05:45 PM
I have a RadForm Dialog that sometimes does some lengthy operations.
In this case, the Form does not always repaint, is that the expected behaviour?
Do I always have to implement some Worker Thread pattern when working with RadForm?


1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 30 Dec 2008, 12:29 PM
Hi Erwin,

Thank you for your question.

In Windows Forms the thread that handles the messages from the operating system to the current application also runs the logic that this messages trigger. In other words, when a Windows Form receives a message that it should repaint, the thread that receives the message also runs the paint logic which will repaint the form. Therefore, when lengthy operations are run in a Windows Application the messages that are sent to your application have to wait until these operations are finished which can sometimes lead to undesired appearance of a Windows Form, since it cannot repaint on time.
The simplest way to workaround this problem is to call Application.DoEvents() within the lengthy operation, if of course you have control over operation's logic. You should be mindful when using DoEvents() as it may cause execution of user input event handlers and so on.
The other solution would be as you guessed, to use a separate thread.
I hope this answers your question.

Do not hesitate to write back if you have any further questions.

Regards,
Author Deyan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Form
Asked by
erwin
Top achievements
Rank 1
Veteran
Answers by
Deyan
Telerik team
Share this question
or