Animation
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.compactframework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Viper
Hi,
I want to show an animated picture while I'm synchronising data. I'm using
the C# language on a Pocket PC 2003.
I tried to use a thread but when I saw that a thread can be started but not
aborted I changed my mind. So I went to the timer control of a form, this
did'nt work.
The last try was with the Timer class using the timerdelegate where I
changed the Image of a picture box every 200 ms. I have 8 images (embedded)
and each 200ms I want the next picture assigned to my picturebox.

This does not work neather.

Can any one help me solving this???

Thanks

Carlo

Reply to this message...
 
    
Alex Yakhnin, MVP (VIP)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/animationcontrol.asp?frame=true

There is also AnimateCtl in the SDF that is based on the source code from
the article:

http://www.opennetcf.org/PermaLink.aspx?guid=3a013afd-791e-45ef-802a-4c1dbe1cfef9

--
Alex Yakhnin, NET CF MVP
IntelliProg, Inc.
http://www.intelliprog.com
"Viper" <Click here to reveal e-mail address> wrote in message
news:jz%tc.279$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Viper
Thanks, this did solve the problem partially.
I mean, during the call of a webservice the animation stops until I got the
data from the weservice. Any idea how I can solve this. For the moment I did
initiate a llopcount of 5 and this way the animation wil run 5 times even if
the ata has already returned (so ready to use). It is faking a delay of
getting the data (just for show) and that is not what I really want.

Carlo
"Alex Yakhnin, MVP" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/animationcontrol.asp?frame=true
[Original message clipped]

Reply to this message...
 
    
Alex Feinman [MVP] (VIP)
Try approaching it from a different angle - make the web service call
asynchronous using BeginXXX/EndXXX calls. Once BeginXXX has returned initate
the animation. When your callback is invoked, set a flag that stops
animation (and call Application.DoEvents to have it processed)

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Viper" <Click here to reveal e-mail address> wrote in message
news:vC4uc.551$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Viper
If I do this I do not get a result of the webservice
If I use the webservice normally like before I get the excepted data in the
dataset.
Here the code I use:
public void SyncEmployees()
{
PocketKilometer.PocketWebservices.PocketKilometer kmWebservice; // The
webservice returning a dataset
AsyncCallback asCb;
kmWebservice = new PocketKilometer.PocketWebservices.PocketKilometer();

asCb= new AsyncCallback(this.SyncComplete);
lblStatus.Text = "Synchronisation ....";
animateCtl1.StartAnimation();// Start the animation (loop = 0)
IAsyncResult asResult =
kmWebservice.BeginGetEmployees(asCb,kmWebservice); // Start the asynchronous
call to the webservice
}

///
/// The callback method for the async call of the webservice
///
public void SyncComplete(IAsyncResult ar)
{
PocketKilometer.PocketWebservices.PocketKilometer kmWebservice =
(PocketKilometer.PocketWebservices.PocketKilometer) ar.AsyncState;
DataTable dt = null;
dt = kmWebservice.EndGetEmployees(ar).Tables[0];
SyncDatabase(dt);
animateCtl1.StopAnimation();
animateCtl1.Show();
}

What's wrong????

"Alex Feinman [MVP]" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Alex Feinman [MVP] (VIP)
The only thing that I see is wrong there is that you are trying to do things
with the Animate control inside the AsyncCallback.
You cannot do this - suchg things are done via Control.Invoke.

What exactly is returned by EndGetEmployees?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Viper" <Click here to reveal e-mail address> wrote in message
news:we5vc.415$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Viper
It si solved and the reason was that, like you said i did something with the
animationcontrol.

Thanks

"Alex Feinman [MVP]" <Click here to reveal e-mail address> wrote in message
news:uj3iN%Click here to reveal e-mail address...
> The only thing that I see is wrong there is that you are trying to do
things
[Original message clipped]

Reply to this message...
 
 
System.AsyncCallback
System.Data.DataTable
System.IAsyncResult
System.Web.UI.Control
System.Windows.Forms.Application




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com