<p>Winform on CF is a bit heavy, initialising a lot of windows handles takes serious time and memory. Another issue is the lack of inbuilt double buffering and lack of control you have over the UI rendering means that during processor intensive operations the UI might leave the user staring at a half rendered screen. Nice!</p>

<p>To alleviate this issue I would seek a lightweight control framework, is there one kicking about already or would one have to homebrew?</p>

<p>By lightweight I mean a control library that enables one to fully control painting of controls and doesn't use many expensive windows handles. </p>

<p>NOTE: Please don't suggest that I am running too much on the UI thread. That is <strong>not</strong> the case.</p>

[{'answer_id': 33229, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': "<p>Actually, you can override the paint event.</p>\n\n<p>And the idea is that you offload long-running operations to a separate thread.  That's no different from any other event-driven framework, really.  <em>Anything</em> that relies on a handling a Paint event is going to be susceptible to that.</p>\n\n<p>Also, there's no system that lets you determine when the paint event is raised. That kind of event is generally raised by the window manager layer, which is outside of the application (or even the framework). You can handle the event yourself and just do no work some of the time, but I wouldn't recommend it.</p>\n"}, {'answer_id': 33232, 'author': 'Chris Karcher', 'author_id': 2773, 'author_profile': 'https://Stackoverflow.com/users/2773', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>a bit slow and you can\'t control the paint event so during processor intensive operations the UI might leave the user staring at a half rendered screen.</p>\n</blockquote>\n\n<p>It\'s generally a bad idea to do expensive tasks on the UI thread.  To keep your UI responsive, these tasks should be performed by a <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="nofollow noreferrer">worker thread</a></p>\n'}, {'answer_id': 143451, 'author': 'SmacL', 'author_id': 22564, 'author_profile': 'https://Stackoverflow.com/users/22564', 'pm_score': 1, 'selected': False, 'text': '<p>Ok, just an idea off the top of my head...</p>\n\n<p>How about creating a synchronisation object, e.g. critical section or single lock, in your application, shared between your worker and gui threads.  Override the paint.  When you start painting, block all the other threads, such that you are not left with a half painted screen while they hog the CPU.</p>\n\n<p>(this of course assumes that presenting a pretty picture to you user is the most important thing you require ;) )</p>\n'}, {'answer_id': 950946, 'author': 'Tim Clem', 'author_id': 7869, 'author_profile': 'https://Stackoverflow.com/users/7869', 'pm_score': 3, 'selected': True, 'text': '<p>I ran across this the other day, which might be helpful at least as a starting point: <a href="http://fluid.codeplex.com/" rel="nofollow noreferrer">Fuild - Windows Mobile .NET Touch Controls</a>. The look and feel is nice, but there is no design time support. I don\'t know too much about memory footprint, etc but everything is double buffered and the performance appears to be pretty good.</p>\n'}]
['https://Stackoverflow.com/questions/33222', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1143/']