We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Loading Animator

Using the loadingAnimator that is provided by syncfusion (AnimatedLoading_GGC-1146142389.zip), I'm trying to implement the behavior in ribbon backstage as shown in the following code snippet.

private void backStage1_SelectedIndexChanged(object sender, EventArgs e)

{

    LoadingAnimator.Wire(backstage1)

    .... doing something

    LoadingAnimator.UnWire(backstage1)

}

the image never show up, it is working fine in the main form with regular control.







{



2 Replies

BB Benson Butt November 22, 2013 04:09 PM UTC

Resolved.

Create a picturebox the same size as the image.  Modify the

private static void PaintControl(object sender)




{



Control ctrl = sender as Control;


if (isAnimate)




{



using (Graphics gr = ctrl.CreateGraphics())




{



ImageAnimator.UpdateFrames(Image);


//gr.DrawImage(Image, new Point(ctrl.Bounds.Width / 2, ctrl.Bounds.Height / 2));


gr.DrawImage(Image, new Point(0,0));




}


}


}

then just bringToFront() the picturebox before calling Wire, and then sendToBack when calling Unwire.

Of course, you can center the picturebox by doing the following

picturebox.left = this.width/2 - picturebox.width/2

picturebox.top = this.height/2 = picturebox.height/2


Hope it helps.





KR Kannan R Syncfusion Team November 26, 2013 03:44 AM UTC

Hi Benson,

 

Thank you for using Syncfusion products.

 

We are glad that, you have found solution for your requirement. Please let us know if you need any further assistance.

 

Regards,

Kannan.R


Loader.
Live Chat Icon For mobile
Up arrow icon