Kurt Vergeyle
New member
- Joined
- Oct 9, 2008
- Messages
- 1
- Programming Experience
- 3-5
Hi everyone,
I'm writing a Windows Forms application that shows movies, images, scrolling text, ... in different panels on a form.
This is the process that I do:
1) I create the different panels on the form
2) I create an object of another class (MyClass), set some properties and call the start method of the created object.
3) The start method creates an instance of a control to show the movie, image, scrolling text, ... and add this instance to the right panel.
--> Step 2 and 3 happens for each panel on the form.
I encounter one problem when I use this process. I see that the scrolling text waits for a short moment when the movie starts to load, after it is loaded the text is running again. I thought that I could fix this problem by using threads.
So I changed my process:
1) I create the different panels on the form (MainThread)
2) I create an object of MyClass and set the property where the movie, image,... has to run in (so in which panel)
3) I create a new thread (MyNewThread). When the thread starts, I execute the start method in the MyClass object. This start method makes a new instance of a control. To add my instance of the control to the panel, I have to invoke my panel. Which results that I'm back in the MainThread. So the control, plays again in the MainThread.
So this process don't solve the problem about my scrolling text.
I want that the controls are running in a different thread than the MainThread. But I think this is not possible, because the main form is running in the MainThread and everything that I want to add on the form has to be done in the MainThread by using the invoke. I'm right?
The only thing that I want is that the instance of a control in a panel is working on his own. So that loading some things in one control does not have an influence on another control.
Has someone any idea to do it?
Thanks in advance,
Kurt.
I'm writing a Windows Forms application that shows movies, images, scrolling text, ... in different panels on a form.
This is the process that I do:
1) I create the different panels on the form
2) I create an object of another class (MyClass), set some properties and call the start method of the created object.
3) The start method creates an instance of a control to show the movie, image, scrolling text, ... and add this instance to the right panel.
--> Step 2 and 3 happens for each panel on the form.
I encounter one problem when I use this process. I see that the scrolling text waits for a short moment when the movie starts to load, after it is loaded the text is running again. I thought that I could fix this problem by using threads.
So I changed my process:
1) I create the different panels on the form (MainThread)
2) I create an object of MyClass and set the property where the movie, image,... has to run in (so in which panel)
3) I create a new thread (MyNewThread). When the thread starts, I execute the start method in the MyClass object. This start method makes a new instance of a control. To add my instance of the control to the panel, I have to invoke my panel. Which results that I'm back in the MainThread. So the control, plays again in the MainThread.
So this process don't solve the problem about my scrolling text.
I want that the controls are running in a different thread than the MainThread. But I think this is not possible, because the main form is running in the MainThread and everything that I want to add on the form has to be done in the MainThread by using the invoke. I'm right?
The only thing that I want is that the instance of a control in a panel is working on his own. So that loading some things in one control does not have an influence on another control.
Has someone any idea to do it?
Thanks in advance,
Kurt.