Improving UI responsiveness of a Marquee through threading

I am looking to improve the responsiveness of a UI control in a .NET project.  It is a scrolling Marquee that displays RSS feeds.  I am using the NetMarquee control from an online source.  It provides a simple control to allow scrolling text.  However, the issue is that when I perform other tasks on the UI it causes the Marquee to stutter.  This is particularly true when I load images onto the UI.  I am working to reduce the workload of the image load, but that isn't really the issue.  It is just the indicator of the issue.  The issue is that the Marquee is affected by the load on the UI.  I want to isolate the Marquee if possible.

What I would like to do is operate the Marquee entirely on its own thread.  It is a self-contained component that would not need to contact the other UI components in any way.  The reverse is true as well.  So far I have found ways to marshal calls to and from worker threads, but this does not help me.  The issue is that the control itself is getting bogged down.

Is there a way to isolate one control?  I can create it at runtime, but I have heard that you cannot create a control with a parent on a different thread.  Is there a way to get around this?

As far as .NET languages go, I can do this in VB.NET or C#, so examples in either would be helpful.  I would welcome any suggestions about how to make this control operate better.  I am using Visual Studio 2008 to create these forms.  If Visual Studio 2010 would bring new features that I could leverage, I would move ahead to that platform to accomplish this task.
LVL 1
biggstrcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
If it truly doesn't need any communication with the app in either direction then simply create a new application to house the control by itself.  Place it into a borderless form and then use the SetParent() API to move it into your main app making it look seamless.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
biggstrcAuthor Commented:
CodeCruiser:
I'll look into that.  It looks interesting, but it will take a bit of work to see if it will really pay out the way I want.  Thanks for the link.  I'll let you know what I find.

Idle_Mind:
Wow, that is something I had not considered.  That seems like a simple solution that might actually work out perfectly for me.  I would still like to figure out some way to run different controls on different threads for other purposes, but this seems like the solution I need for this project.  I'll try it out and let you know how it works out.

Thanks to both of you for your help in this matter.  If you have any more bright ideas before I get back to you, please let me know.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Mike TomlinsonMiddle School Assistant TeacherCommented:
As a general rule of thumb: "All controls run in the SAME main UI thread".  =(

Translation: You can't run just one control in its own thread.

CodeCruisers post really describes how to put WORK into a different thread while correctly displaying progress on the main UI thread.
0
biggstrcAuthor Commented:
CodeCruiser:

The solution you posted seems to be optimized only when it comes to background processing.  The problem is that all of my processing has to be done on the foreground.  I am using GDI to move the crawl across the screen.  I can't put this type of code into a background thread.

Idle_Mind:
I think your solution is going to work.  I am working up a prototype now.  I got it to run, but I'm still working on how to get the window to resize, move, and close how I want it to.  You (or anyone else) wouldn't happen to have some example code (preferably in VB.NET but either will do) that shows how to do this would you?
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
0
biggstrcAuthor Commented:
I was able to get this to work finally.  The information from Idle_Mind really helped get me down the path.  I had to add to the solution, however, because I needed extra features (resize, close on application close, etc.) I browsed the web for a more full example.  I found this article:

http://www.codeproject.com/KB/miscctrl/AppControl.aspx

That took the SetParent() idea and made a control out of it that does just about everything I wanted it to do.  There are a couple of notes that I found were important to this setup though.  First, I wanted my sub-application (the RSS Feed) to be transparent so that it would take on the color scheme of the parent.  This works fine until you call it using the SetParent() API call.  Then it disappears entirely.  Still not sure why, but I decided not to mess with it.  I also found that it didn't like it if the sub-application didn't have a normal window around it.  There is code in the actual control that you can comment out or modify to get around this, but I decided that it was easier just to keep the normal form window since the control scrapes it off.

I appreciate all of the help.  The end result is that I have what I wanted in a working condition.  I am using a different thread for a UI component.
0
biggstrcAuthor Commented:
Further explanation on the web with examples was necessary, but this solution pointed me in the right direction.  Further clarification was also added to this discussion near the end.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.