RadForm looses Skin when Event Processing Blocks

2 posts, 0 answers
  1. erwin
    erwin avatar
    392 posts
    Member since:
    Dec 2006

    Posted 29 Dec 2008 Link to this post

    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?

  2. Deyan
    Deyan avatar
    2147 posts

    Posted 30 Dec 2008 Link to this post

    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.

    Author Deyan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top