This is a migrated thread and some comments may be shown as answers.

Animating Panel through AnimatedPropertySetting Class

2 Answers 183 Views
Panel
This is a migrated thread and some comments may be shown as answers.
Awais
Top achievements
Rank 1
Awais asked on 18 Feb 2013, 06:38 PM

  Hey !!
     I am trying to animate rad panel using Animated property class. But only Panel Border is animating. its child controls doesn't animate. I am facing a problem about user-controls not loading smoothly So I want to make it smooth by animating Panel.!! 

   Documentation Link "   http://www.telerik.com/help/winforms/tpf-animations.html

   Here is the link from telerik documentation. Checkout its 3rd example in which panel is animating. ! It is not working seriously ! .. Kindly tell me the solution to animate panel using this class or suggest any alternative

2 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 21 Feb 2013, 04:59 PM
Hello Awais,

Thank you for bringing our attention to this issue. 

In Q3 2012 we changed the sizing policy of our controls and this caused the issue with this example. You should use the following code to animate RadPanel bounds:

RadPanel panel = new RadPanel();
panel.BackColor = Color.Yellow;
panel.AutoSize = true;
panel.RootElement.StretchVertically = true;
panel.RootElement.StretchHorizontally = true;
panel.Location = new Point(10, 10);
panel.Size = new Size(200, 1);
panel.Text = "I am RadPanel";
this.Controls.Add(panel);
 
AnimatedPropertySetting setting = new AnimatedPropertySetting();
setting.Property = RadElement.BoundsProperty;
setting.StartValue = new Rectangle(0, 0, 200, 1);
setting.EndValue = new Rectangle(0, 0, 200, 100);
setting.Interval = 30;
setting.NumFrames = 10;
setting.ApplyValue(panel.RootElement);

The only change is that you should set StretchHorizontally and StretchVertically properties of RadPanel RootElement property to true. We will correct our documentation.

All the best,
Plamen
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Awais
Top achievements
Rank 1
answered on 21 Feb 2013, 05:16 PM

 Thankyou very Much Plamen !! It Worked :)
Tags
Panel
Asked by
Awais
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Awais
Top achievements
Rank 1
Share this question
or