Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > WinForms Carousel

Not answered WinForms Carousel

Feed from this thread
  • Chris Lynch avatar

    Posted on Oct 23, 2010 (permalink)

    I want to launch a new form after a carousel selected element has rotated into position 
    but I can not find any (end of rotation event) that will allow me to do this.
    Is there one or is there a techinque I can use to simulate this

    Reply

  • Peter Peter admin's avatar

    Posted on Oct 28, 2010 (permalink)

    Hello Chris,

    Thank you for writing.

    I would suggest that you handle the SelectedIndexChanged event. This event will be fired when the carousel items are rotated.

    I hope this helps. If you have any other questions or comments, please let me know.

    All the best,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Chris Lynch avatar

    Posted on Oct 28, 2010 (permalink)

    Peter
    Thanks for your suggestion ,but it doesn't help
    That event fires prior to rotation not after rotation has completed.
    Chris

    Reply

  • Posted on Oct 29, 2010 (permalink)

    Hello Chris,

    Sadly, currently there is no such thing, but there are 2 ways you can achieve this, either create a custom event on the form that will fire when the animation has completed, either create a custom Carrousel,
    I will post here examples of how to achieve both of these things:
    // create a new Event here
    public event EventHandler EventThatFiresAfterRotationCompleted;
     
    public Form1()
    {
        InitializeComponent();
       // handle the selected index changed operation here, and create a timer that will fire after the animation for the carousel is finalized
        radCarousel1.SelectedIndexChanged += delegate
        {
            var timer = new System.Windows.Forms.Timer();
            timer.Interval = radCarousel1.AnimationDelay * radCarousel1.AnimationFrames;
            timer.Tick += delegate
            {
                timer.Stop();
                if (EventThatFiresAfterRotationCompleted != null)
                {
                    EventThatFiresAfterRotationCompleted(radCarousel1, EventArgs.Empty);
                }
            };
            timer.Start();
        };
         
        //register for event
        this.EventThatFiresAfterRotationCompleted += new EventHandler(Form1_EventThatFiresAfterRotationCompleted);
    }
     
    void Form1_EventThatFiresAfterRotationCompleted(object sender, EventArgs e)
    {
        MessageBox.Show("AnimationCompleted");
    }

    Or the second one with the custom Carrousel:
    public class CustomRadCarousel : RadCarousel
    {
        public event EventHandler EventThatFiresAfterRotationCompleted;
     
        public CustomRadCarousel()
            : base()
        {
            SelectedIndexChanged += delegate
            {
                var timer = new System.Windows.Forms.Timer();
                timer.Interval = this.AnimationDelay * this.AnimationFrames;
                timer.Tick += delegate
                {
                    timer.Stop();
                    RaiseEventThatFiresAfterRotationCompleted();
                };
                timer.Start();
            };
        }
     
        private void RaiseEventThatFiresAfterRotationCompleted()
        {
            if (EventThatFiresAfterRotationCompleted != null)
            {
                EventThatFiresAfterRotationCompleted(this, EventArgs.Empty);
            }
        }
    }

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Reply

  • Peter Peter admin's avatar

    Posted on Nov 2, 2010 (permalink)

    Hello Chris Lynch,

    Thank you for the provided details.

    I could suggest that you use RadCarousel.CarouselElement's AnimationFinished event.
    This event will be fired when the animation is finished.

    Let me know if you have any other questions.

    Sincerely yours,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > WinForms Carousel